@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.
Files changed (132) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +6 -2
  3. package/dist/analyst/index.d.ts +52 -43
  4. package/dist/analyst/index.js +4 -4
  5. package/dist/belief-state/index.d.ts +35 -40
  6. package/dist/belief-state/index.js +2 -2
  7. package/dist/benchmarks/index.d.ts +30 -12
  8. package/dist/benchmarks/index.js +12 -11
  9. package/dist/builder-eval/index.js +1 -1
  10. package/dist/campaign/index.d.ts +441 -160
  11. package/dist/campaign/index.js +11 -10
  12. package/dist/{chunk-IILEIWGW.js → chunk-2JX3CFMB.js} +100 -40
  13. package/dist/chunk-2JX3CFMB.js.map +1 -0
  14. package/dist/chunk-2MKQIFS4.js +183 -0
  15. package/dist/chunk-2MKQIFS4.js.map +1 -0
  16. package/dist/{chunk-NUKSVU3W.js → chunk-5DTSBUL2.js} +2 -2
  17. package/dist/{chunk-H5UD2323.js → chunk-7ZZMD7UK.js} +102 -2
  18. package/dist/chunk-7ZZMD7UK.js.map +1 -0
  19. package/dist/{chunk-474LBSOX.js → chunk-BYT7ELPS.js} +45 -18
  20. package/dist/chunk-BYT7ELPS.js.map +1 -0
  21. package/dist/{chunk-LUNF2SEL.js → chunk-DJKY2TSY.js} +3 -3
  22. package/dist/chunk-DPUHNQLN.js +232 -0
  23. package/dist/chunk-DPUHNQLN.js.map +1 -0
  24. package/dist/chunk-DRYIUNWY.js +622 -0
  25. package/dist/chunk-DRYIUNWY.js.map +1 -0
  26. package/dist/{chunk-IPYXE555.js → chunk-EJGRPCO3.js} +36 -13
  27. package/dist/chunk-EJGRPCO3.js.map +1 -0
  28. package/dist/{chunk-OCFJACJU.js → chunk-EOSZT7PL.js} +82 -18
  29. package/dist/chunk-EOSZT7PL.js.map +1 -0
  30. package/dist/{chunk-ZVCHKKOP.js → chunk-EZJEIH2R.js} +39 -15
  31. package/dist/chunk-EZJEIH2R.js.map +1 -0
  32. package/dist/{chunk-M7AH34KV.js → chunk-IHQDPH7D.js} +32 -16
  33. package/dist/chunk-IHQDPH7D.js.map +1 -0
  34. package/dist/{chunk-PJQFMIOX.js → chunk-MHELPNRP.js} +31 -1
  35. package/dist/chunk-MHELPNRP.js.map +1 -0
  36. package/dist/{chunk-K6IAZZ6L.js → chunk-NACAGYSY.js} +153 -122
  37. package/dist/chunk-NACAGYSY.js.map +1 -0
  38. package/dist/{chunk-BTACVO2W.js → chunk-NKAGIDE2.js} +542 -258
  39. package/dist/chunk-NKAGIDE2.js.map +1 -0
  40. package/dist/{chunk-ARU2PZFM.js → chunk-NYLOYM6N.js} +43 -23
  41. package/dist/chunk-NYLOYM6N.js.map +1 -0
  42. package/dist/{chunk-QOTFXW5L.js → chunk-P5W7RQKK.js} +2 -2
  43. package/dist/{chunk-IR3KBHOY.js → chunk-P6FYH6K4.js} +39 -3
  44. package/dist/chunk-P6FYH6K4.js.map +1 -0
  45. package/dist/{chunk-J5SQWP6Y.js → chunk-PBE2LOSS.js} +18 -2
  46. package/dist/chunk-PBE2LOSS.js.map +1 -0
  47. package/dist/{chunk-X4UCIOTZ.js → chunk-S5YLIBFX.js} +2 -2
  48. package/dist/{chunk-7VYEGHWF.js → chunk-SZLVEKMJ.js} +41 -20
  49. package/dist/chunk-SZLVEKMJ.js.map +1 -0
  50. package/dist/{chunk-P22LJ3Y2.js → chunk-TBL77AUT.js} +8 -8
  51. package/dist/chunk-TBL77AUT.js.map +1 -0
  52. package/dist/{chunk-LKKT3IVV.js → chunk-TSN7JT6D.js} +6 -4
  53. package/dist/{chunk-LKKT3IVV.js.map → chunk-TSN7JT6D.js.map} +1 -1
  54. package/dist/{chunk-E3IADPLG.js → chunk-UB2LOJ6Q.js} +51 -227
  55. package/dist/chunk-UB2LOJ6Q.js.map +1 -0
  56. package/dist/{chunk-MAX3TN3C.js → chunk-UWZZKKU7.js} +7 -19
  57. package/dist/chunk-UWZZKKU7.js.map +1 -0
  58. package/dist/{chunk-DPZAEKA6.js → chunk-VLOATJQ2.js} +85 -57
  59. package/dist/chunk-VLOATJQ2.js.map +1 -0
  60. package/dist/{chunk-MOXWMGPC.js → chunk-XDWDC2MP.js} +197 -79
  61. package/dist/chunk-XDWDC2MP.js.map +1 -0
  62. package/dist/{chunk-CGG5SLH3.js → chunk-XPRT64IE.js} +2 -2
  63. package/dist/{chunk-FO7HEH76.js → chunk-YJBNWCAA.js} +2 -2
  64. package/dist/{chunk-KE2VWPZX.js → chunk-ZUUWPZCV.js} +3 -3
  65. package/dist/cli.js +4 -4
  66. package/dist/contract/index.d.ts +438 -138
  67. package/dist/contract/index.js +259 -113
  68. package/dist/contract/index.js.map +1 -1
  69. package/dist/control.d.ts +56 -39
  70. package/dist/control.js +2 -3
  71. package/dist/hosted/index.d.ts +152 -51
  72. package/dist/hosted/index.js +24 -1
  73. package/dist/index.d.ts +399 -277
  74. package/dist/index.js +363 -244
  75. package/dist/index.js.map +1 -1
  76. package/dist/meta-eval/index.d.ts +33 -36
  77. package/dist/meta-eval/index.js +2 -2
  78. package/dist/multishot/index.d.ts +1 -0
  79. package/dist/openapi.json +1 -1
  80. package/dist/pipelines/index.js +2 -2
  81. package/dist/reporting.d.ts +101 -80
  82. package/dist/reporting.js +7 -5
  83. package/dist/rl.d.ts +198 -142
  84. package/dist/rl.js +235 -127
  85. package/dist/rl.js.map +1 -1
  86. package/dist/rollout/index.d.ts +54 -67
  87. package/dist/rollout/index.js +6 -5
  88. package/dist/{run-campaign-FFRM3RH5.js → run-campaign-ISHFZ7FJ.js} +6 -3
  89. package/dist/supervisor-run/index.d.ts +7 -15
  90. package/dist/supervisor-run/index.js +2 -2
  91. package/dist/traces.d.ts +72 -50
  92. package/dist/traces.js +9 -6
  93. package/dist/wire/index.d.ts +1 -0
  94. package/dist/wire/index.js +2 -2
  95. package/docs/concepts.md +18 -1
  96. package/docs/customer-journeys.md +7 -6
  97. package/docs/hosted-ingest-spec.md +37 -40
  98. package/docs/insight-report.md +78 -7
  99. package/docs/research-report-methodology.md +20 -21
  100. package/docs/rollout.md +13 -8
  101. package/package.json +4 -3
  102. package/dist/chunk-474LBSOX.js.map +0 -1
  103. package/dist/chunk-7VYEGHWF.js.map +0 -1
  104. package/dist/chunk-ARU2PZFM.js.map +0 -1
  105. package/dist/chunk-BTACVO2W.js.map +0 -1
  106. package/dist/chunk-DPZAEKA6.js.map +0 -1
  107. package/dist/chunk-E3IADPLG.js.map +0 -1
  108. package/dist/chunk-H5UD2323.js.map +0 -1
  109. package/dist/chunk-IILEIWGW.js.map +0 -1
  110. package/dist/chunk-IPYXE555.js.map +0 -1
  111. package/dist/chunk-IR3KBHOY.js.map +0 -1
  112. package/dist/chunk-J5SQWP6Y.js.map +0 -1
  113. package/dist/chunk-K6IAZZ6L.js.map +0 -1
  114. package/dist/chunk-M7AH34KV.js.map +0 -1
  115. package/dist/chunk-MAX3TN3C.js.map +0 -1
  116. package/dist/chunk-MOXWMGPC.js.map +0 -1
  117. package/dist/chunk-OCFJACJU.js.map +0 -1
  118. package/dist/chunk-P22LJ3Y2.js.map +0 -1
  119. package/dist/chunk-PJQFMIOX.js.map +0 -1
  120. package/dist/chunk-VSMTAMNK.js +0 -53
  121. package/dist/chunk-VSMTAMNK.js.map +0 -1
  122. package/dist/chunk-ZVCHKKOP.js.map +0 -1
  123. package/dist/chunk-ZZUXHH3R.js +0 -99
  124. package/dist/chunk-ZZUXHH3R.js.map +0 -1
  125. /package/dist/{chunk-NUKSVU3W.js.map → chunk-5DTSBUL2.js.map} +0 -0
  126. /package/dist/{chunk-LUNF2SEL.js.map → chunk-DJKY2TSY.js.map} +0 -0
  127. /package/dist/{chunk-QOTFXW5L.js.map → chunk-P5W7RQKK.js.map} +0 -0
  128. /package/dist/{chunk-X4UCIOTZ.js.map → chunk-S5YLIBFX.js.map} +0 -0
  129. /package/dist/{chunk-CGG5SLH3.js.map → chunk-XPRT64IE.js.map} +0 -0
  130. /package/dist/{chunk-FO7HEH76.js.map → chunk-YJBNWCAA.js.map} +0 -0
  131. /package/dist/{chunk-KE2VWPZX.js.map → chunk-ZUUWPZCV.js.map} +0 -0
  132. /package/dist/{run-campaign-FFRM3RH5.js.map → run-campaign-ISHFZ7FJ.js.map} +0 -0
@@ -237,6 +237,7 @@ type CostLedgerHandle = Pick<CostLedger, Exclude<keyof CostLedger, 'listPending'
237
237
  * OpenAI-compatible `/v1/chat/completions` client with:
238
238
  * - Exponential-backoff retry on 429 + 5xx gateway errors (502/503/504).
239
239
  * - Retry on transient network errors (fetch failed, AbortError, ECONNRESET).
240
+ * - One retry at temperature 1 when a model explicitly requires it.
240
241
  * - Graceful json_schema → json_object degrade on 400 with schema-reject body.
241
242
  * - Fenced-JSON stripping (```json ... ```) for models that wrap structured output.
242
243
  * - Configurable base URL + api key / bearer, works with LiteLLM proxies, OpenAI
@@ -419,7 +420,8 @@ type FailureClass = 'success' | 'reasoning_error' | 'tool_selection_error' | 'to
419
420
  * researcher loop SHOULD be recorded as a `RunRecord`. The mandatory
420
421
  * fields are exactly those the paper "Two Loops, Three Roles" requires
421
422
  * for reproducibility: who/what/when/cost/seed/hash, plus the search vs
422
- * holdout split tag and either a `searchScore` or a `holdoutScore`.
423
+ * holdout split tag. A task score is optional because execution-only records
424
+ * must preserve missing labels instead of converting errors into zero quality.
423
425
  *
424
426
  * This is intentionally NOT a replacement for the rich `Run` /
425
427
  * `ProposeReviewReport` / `ScenarioResult` types already in the
@@ -440,6 +442,13 @@ type FailureClass = 'success' | 'reasoning_error' | 'tool_selection_error' | 'to
440
442
  /** Search/dev/holdout split tag. 'search' is the paper-grade alias for the
441
443
  * combined train+test pool that the optimizer is allowed to read. */
442
444
  type RunSplitTag = 'search' | 'dev' | 'holdout';
445
+ /**
446
+ * Explicit execution-lifecycle result for a run.
447
+ *
448
+ * This is separate from task quality (`outcome`) and failure classification.
449
+ * Producers set it only from root-run or process evidence.
450
+ */
451
+ type RunTerminalOutcome = 'succeeded' | 'failed' | 'cancelled' | 'incomplete' | 'unknown';
443
452
  interface RunTokenUsage {
444
453
  input: number;
445
454
  /** All generated tokens charged as output, including reasoning tokens. */
@@ -453,11 +462,6 @@ interface RunTokenUsage {
453
462
  }
454
463
  /**
455
464
  * How a run's USD amount was obtained.
456
- *
457
- * `costUsd` remains mandatory for wire compatibility. New producers should
458
- * always populate this discriminated union so a missing bill is never
459
- * mistaken for an observed zero-dollar run. For `uncaptured`, `costUsd` uses
460
- * the legacy `0` sentinel while this field carries the truthful null.
461
465
  */
462
466
  type RunCostProvenance = {
463
467
  kind: 'observed';
@@ -503,8 +507,8 @@ interface JudgeScoresRecord {
503
507
  perJudge: Record<string, Record<string, number>>;
504
508
  /** Per-dim mean across judges. Convenience — derivable from `perJudge`. */
505
509
  perDimMean: Record<string, number>;
506
- /** Composite mean across all dims and judges. Mirrors the score
507
- * the gate sees on `outcome.searchScore` / `holdoutScore`. */
510
+ /** Composite mean across successful judges. Mirrors the task score only
511
+ * when `failedJudges` is empty. */
508
512
  composite: number;
509
513
  /** Judges that errored or returned an unparseable verdict. Recorded
510
514
  * by id (e.g. `['glm-5.1']`) so a partial-failure case is explicit,
@@ -515,11 +519,11 @@ interface JudgeScoresRecord {
515
519
  notes?: string;
516
520
  }
517
521
  interface RunOutcome {
518
- /** Score on the search/optimization split. Optional because a
519
- * holdout-only evaluation only fills `holdoutScore`. */
522
+ /** Score on the search/optimization split. Optional for holdout-only and
523
+ * execution-only records. */
520
524
  searchScore?: number;
521
- /** Score on the held-out split. Optional because a search-only run
522
- * only fills `searchScore`. At least one must be present. */
525
+ /** Score on the held-out split. Optional for search-only and execution-only
526
+ * records. When both scores are absent, the run is explicitly unlabeled. */
523
527
  holdoutScore?: number;
524
528
  /** Bag of any other metric the run produced — judge dimensions,
525
529
  * pass/fail counters, latency stats, etc. Numeric only — keeps
@@ -583,42 +587,36 @@ interface RunRecord {
583
587
  wallMs: number;
584
588
  /** Time spent queued before execution started, if known. */
585
589
  queueMs?: number;
586
- /** Total USD cost. Mandatory runs without a cost number are
587
- * unbounded by definition and must not be admitted into the gate.
588
- * `0` is retained as the compatibility sentinel for an uncaptured amount;
589
- * inspect `costProvenance` before treating it as observed. */
590
- costUsd: number;
591
- /** Observed, model-priced estimate, or genuinely uncaptured USD amount.
592
- * Optional only so existing serialized RunRecords remain valid. */
593
- costProvenance?: RunCostProvenance;
590
+ /** Total USD cost, or null when the producer could not capture one. */
591
+ costUsd: number | null;
592
+ /** Whether `costUsd` came from billing data, a price calculation, or is unavailable. */
593
+ costProvenance: RunCostProvenance;
594
594
  /** Token usage breakdown. */
595
595
  tokenUsage: RunTokenUsage;
596
+ /** Root-run or process terminal result. Never inferred from a child span. */
597
+ terminalOutcome: RunTerminalOutcome;
598
+ /** Root-run or process failure reason. Valid only for a failed, cancelled,
599
+ * or incomplete terminal result; never populated from a child span. */
600
+ terminalFailureReason?: string;
596
601
  /** Judge-side metadata, if a judge was used. */
597
602
  judgeMetadata?: RunJudgeMetadata;
598
603
  /** Per-split scores + raw bag. */
599
604
  outcome: RunOutcome;
600
- /** Canonical, cross-agent failure class drawn from the shared
601
- * `FAILURE_CLASSES` taxonomy. This is the aggregation key that makes
602
- * "which failure dominates across the whole fleet" answerable in ONE
603
- * vocabulary — every agent classifies against the same enum. Producers
604
- * set it via the substrate classifier; leave unset only when the failure
605
- * genuinely can't be classified. */
605
+ /** Canonical task-failure class drawn from the shared
606
+ * `FAILURE_CLASSES` taxonomy. Producers set it only from task-result
607
+ * evidence. Execution errors belong in
608
+ * `outcome.raw.execution_error_count`. */
606
609
  failureClass?: FailureClass;
607
- /** Free-form domain-specific failure detail, scoped UNDER `failureClass`
608
- * (e.g. failureClass='tool_recovery_failure', failureMode='forge_build_unsatisfied').
609
- * The within-agent drill-down; `failureClass` is the cross-agent key. */
610
+ /** Free-form task-failure detail scoped under a non-success
611
+ * `failureClass`. It is invalid without that class. */
610
612
  failureMode?: string;
611
613
  /** Which split this run was drawn from. */
612
614
  splitTag: RunSplitTag;
613
615
  /**
614
- * Stable scenario identifier the run was scored against. Optional for
615
- * backwards compatibility, but **strongly recommended**: every primitive
616
- * that pairs runs by scenario (preferences, paired stats, BT tournament)
617
- * keys on this. The campaign artifact populates it canonically; legacy
618
- * runs without it fall back to inference from `outcome.raw.scenario_id`
619
- * or `experimentId`.
616
+ * Stable scenario identifier the run observed or was scored against.
617
+ * Comparison primitives match this identity rather than input order.
620
618
  */
621
- scenarioId?: string;
619
+ scenarioId: string;
622
620
  /**
623
621
  * Canonical identity for the agent profile cell that produced this row:
624
622
  * profile artifact hash plus optional harness/model/prompt/reporting
@@ -976,6 +974,13 @@ interface OptimizerConfig extends OptimizerConfigBase {
976
974
  }
977
975
  /** Five-valued verdict taxonomy (MOSS-paper alignment). */
978
976
  type GateDecision = 'ship' | 'hold' | 'need_more_work' | 'model_ceiling' | 'arch_ceiling';
977
+ /** Outcome of one check that contributed to a release decision. */
978
+ type GateCheckStatus = 'pass' | 'fail' | 'not_evaluated';
979
+ interface GateContribution {
980
+ name: string;
981
+ status: GateCheckStatus;
982
+ detail: unknown;
983
+ }
979
984
  interface GateContext<TArtifact, TScenario extends Scenario> {
980
985
  candidateArtifacts: Map<string, TArtifact>;
981
986
  baselineArtifacts?: Map<string, TArtifact>;
@@ -1009,11 +1014,7 @@ interface GateContext<TArtifact, TScenario extends Scenario> {
1009
1014
  interface GateResult {
1010
1015
  decision: GateDecision;
1011
1016
  reasons: string[];
1012
- contributingGates: Array<{
1013
- name: string;
1014
- passed: boolean;
1015
- detail: unknown;
1016
- }>;
1017
+ contributingGates: GateContribution[];
1017
1018
  delta?: number;
1018
1019
  }
1019
1020
  /** Composable promotion gate. */
@@ -1157,6 +1158,10 @@ interface CampaignCellResult<TArtifact> {
1157
1158
  durationMs: number;
1158
1159
  seed: number;
1159
1160
  cached: boolean;
1161
+ /** Stage that produced `error`. Missing on successful cells. */
1162
+ errorStage?: 'dispatch' | 'judge';
1163
+ /** Judge that threw when `errorStage` is `judge`. */
1164
+ errorJudge?: string;
1160
1165
  error?: string;
1161
1166
  }
1162
1167
  interface JudgeAggregate {
@@ -1181,8 +1186,10 @@ interface GenerationRecord {
1181
1186
  * handled — the evidence a blind `Mutator` cannot see. */
1182
1187
  interface GenerationCandidate {
1183
1188
  surfaceHash: string;
1184
- composite: number;
1185
- ci95: [number, number];
1189
+ /** Mean over complete task-quality scores, or null when none were produced. */
1190
+ composite: number | null;
1191
+ /** Descriptive interval for `composite`, or null when no score exists. */
1192
+ ci95: [number, number] | null;
1186
1193
  /** Exact surface this candidate mutated. */
1187
1194
  parentSurfaceHash?: string;
1188
1195
  /** Measured search-split composite of the exact parent surface. */
@@ -1192,13 +1199,12 @@ interface GenerationCandidate {
1192
1199
  observedDeltaFromParent?: number;
1193
1200
  /** Whether this candidate had a scorable result for every designed campaign
1194
1201
  * cell and was therefore eligible for ranking, promotion, and Pareto
1195
- * selection. Older externally-authored records may omit this field; loop
1196
- * records always populate it. */
1197
- eligibleForPromotion?: boolean;
1202
+ * selection. */
1203
+ eligibleForPromotion: boolean;
1198
1204
  /** Exact denominator receipt for selection eligibility. Scores stay
1199
1205
  * descriptive: an incomplete candidate is retained with its observed score
1200
1206
  * and errors instead of receiving an invented penalty. */
1201
- coverage?: {
1207
+ coverage: {
1202
1208
  expectedCells: number;
1203
1209
  scorableCells: number;
1204
1210
  unscorableCells: Array<{
@@ -1239,10 +1245,18 @@ interface CampaignAggregates {
1239
1245
  cost: CostLedgerSummary;
1240
1246
  /** Compatibility alias of `cost.totalCostUsd`. */
1241
1247
  totalCostUsd: number;
1248
+ /** Cells whose dispatch completed, including cells whose later judge failed. */
1242
1249
  cellsExecuted: number;
1243
1250
  cellsSkipped: number;
1244
1251
  cellsCached: number;
1252
+ /** All non-skipped dispatch, judge, and unclassified cell failures. */
1245
1253
  cellsFailed: number;
1254
+ /** Present on results that record failure stages. */
1255
+ cellsDispatchFailed?: number;
1256
+ /** Present on results that record failure stages. */
1257
+ cellsJudgeFailed?: number;
1258
+ /** Legacy failures whose stage was not recorded. */
1259
+ cellsUnclassifiedFailed?: number;
1246
1260
  }
1247
1261
  interface CampaignResult<TArtifact = unknown, TScenario extends Scenario = Scenario> {
1248
1262
  /** sha256(scenarios, judges, dispatch source ref, optimizer config, seed). Stable identity for reruns. */
@@ -1379,7 +1393,7 @@ declare function createReferenceEquivalenceJudge(options: ReferenceEquivalenceJu
1379
1393
  * `ViewTraceOversized`.
1380
1394
  */
1381
1395
  /** OTLP span kind (subset we actually use). */
1382
- type TraceAnalystSpanKind = 'AGENT' | 'LLM' | 'TOOL' | 'CHAIN' | 'GUARDRAIL' | 'SPAN' | 'UNKNOWN';
1396
+ type TraceAnalystSpanKind = 'AGENT' | 'LLM' | 'TOOL' | 'CHAIN' | 'EVALUATOR' | 'GUARDRAIL' | 'SPAN' | 'UNKNOWN';
1383
1397
  type TraceAnalystSpanStatus = 'OK' | 'ERROR' | 'UNSET';
1384
1398
  /** Subset of OTLP span fields the analyst exposes to the agent. The
1385
1399
  * store's job is to project upstream's full span shape down to this
@@ -1948,10 +1962,10 @@ interface PairedMetricDelta {
1948
1962
  n: number;
1949
1963
  /** Pairs where at least one side does not carry the metric. */
1950
1964
  nMissing: number;
1951
- /** Median paired delta; NaN when `n === 0` (no data ≠ measured zero). */
1952
- medianDelta: number;
1953
- /** Mean paired delta; NaN when `n === 0`. */
1954
- meanDelta: number;
1965
+ /** Median paired delta, or null when `n === 0`. */
1966
+ medianDelta: number | null;
1967
+ /** Mean paired delta, or null when `n === 0`. */
1968
+ meanDelta: number | null;
1955
1969
  /** Bootstrap CI on the paired delta (`pairedBootstrap`); null when
1956
1970
  * `n === 0` — a zero-width [0, 0] interval on no data would read as a
1957
1971
  * measured tight null. */
@@ -2856,6 +2870,86 @@ declare function planEvalFixtureRun<TArtifact = unknown>(options: PlanEvalFixtur
2856
2870
  * (so the result records every gate's reason — useful for diagnostics). */
2857
2871
  declare function composeGate<TArtifact = unknown, TScenario extends Scenario = Scenario>(...gates: Array<Gate<TArtifact, TScenario>>): Gate<TArtifact, TScenario>;
2858
2872
 
2873
+ /**
2874
+ * Liveness canaries — cheap statistical checks that catch the failure
2875
+ * modes a green test suite never sees.
2876
+ *
2877
+ * Three canary types in this module:
2878
+ *
2879
+ * 1. **Silent judge fallback** — the judge degraded to a fallback
2880
+ * path (rules-only / cached / heuristic) without anyone
2881
+ * noticing. Signature: a string of consecutive runs whose
2882
+ * `judgeMetadata.confidence` equals a known fallback constant
2883
+ * (default 0.30) OR whose `judgeMetadata.fallback` is true.
2884
+ *
2885
+ * 2. **Judge calibration drift** — the judge's confidence
2886
+ * distribution has drifted from a historical window. Two-sample
2887
+ * Kolmogorov-Smirnov test on the recent vs historical confidences,
2888
+ * with the empirical-CDF max-difference statistic.
2889
+ *
2890
+ * 3. **Eval-set distribution shift** — the mix of categories /
2891
+ * buckets in the recent runs differs significantly from the
2892
+ * historical mix. Chi-square test on the binned counts.
2893
+ *
2894
+ * Outputs are alerts. The canary does NOT fail loud the way a test
2895
+ * does — failing tests are reserved for hard correctness violations.
2896
+ * A canary that fires is a *signal* to investigate, not a verdict.
2897
+ *
2898
+ * Why this lives here rather than in `observability.ts`: that module
2899
+ * exports already, and is a pure-fanout-to-Langfuse/Prometheus
2900
+ * adapter. Canaries are statistical detectors, not adapters.
2901
+ */
2902
+
2903
+ interface CanaryOptions {
2904
+ /**
2905
+ * Silent-fallback detection.
2906
+ * - `constant`: confidence value treated as the fallback signal.
2907
+ * Default 0.30 (matches the soft-fail default in
2908
+ * `propose-review.ts`).
2909
+ * - `consecutiveThreshold`: trip the alert after this many
2910
+ * consecutive runs at `constant` (or `fallback === true`).
2911
+ * Default 3.
2912
+ */
2913
+ silentFallback?: {
2914
+ constant?: number;
2915
+ consecutiveThreshold?: number;
2916
+ /** Floating-point tolerance when comparing against `constant`. */
2917
+ epsilon?: number;
2918
+ };
2919
+ /**
2920
+ * Calibration-drift detection.
2921
+ * - `historyWindow`: number of past runs (oldest-first) treated as
2922
+ * the historical baseline. Default 50.
2923
+ * - `recentWindow`: number of recent runs (newest-first) compared
2924
+ * against history. Default 20.
2925
+ * - `ksAlpha`: alpha for the KS statistic vs critical value.
2926
+ * Default 0.05.
2927
+ * - `minRecent`: minimum recent runs required to even attempt the
2928
+ * check. Default 10.
2929
+ */
2930
+ calibrationDrift?: {
2931
+ historyWindow?: number;
2932
+ recentWindow?: number;
2933
+ ksAlpha?: number;
2934
+ minRecent?: number;
2935
+ };
2936
+ /**
2937
+ * Distribution-shift detection.
2938
+ * - `category`: function that maps a run to a categorical bucket.
2939
+ * Required to enable this canary; if omitted the chi-square check
2940
+ * is skipped entirely.
2941
+ * - `chiSquareAlpha`: alpha. Default 0.05.
2942
+ * - `historyWindow`, `recentWindow`, `minRecent`: like above.
2943
+ */
2944
+ distributionShift?: {
2945
+ category: (run: RunRecord) => string | null;
2946
+ chiSquareAlpha?: number;
2947
+ historyWindow?: number;
2948
+ recentWindow?: number;
2949
+ minRecent?: number;
2950
+ };
2951
+ }
2952
+
2859
2953
  /**
2860
2954
  * Dataset — versioned, sliceable, content-hashed scenario collection.
2861
2955
  *
@@ -2927,6 +3021,178 @@ interface RedTeamCase extends DatasetScenario {
2927
3021
  payload: RedTeamPayload;
2928
3022
  }
2929
3023
 
3024
+ /**
3025
+ * Validator-output verdict — substrate primitive for "did this output pass,
3026
+ * and how well?"
3027
+ *
3028
+ * Used by:
3029
+ * - `@tangle-network/agent-eval/matrix` — verdict per cell in the cartesian.
3030
+ * - `@tangle-network/agent-runtime` — Validator<Output, Verdict = DefaultVerdict>.
3031
+ * Runtime keeps `Validator` because it's coupled to runtime-shaped
3032
+ * `ValidationCtx` (iteration, signal, traceEmitter); the verdict TYPE
3033
+ * itself is a substrate concept and lives here.
3034
+ *
3035
+ * Repo layering: agent-eval is the substrate (no upward deps). Both
3036
+ * agent-runtime and agent-knowledge consume this type FROM agent-eval —
3037
+ * never the other way around. See CLAUDE.md "Repo layering" for the rule.
3038
+ */
3039
+ /**
3040
+ * Minimal verdict shape — `valid` + `score` are required; `scores` +
3041
+ * `notes` are optional surface. Validators that need richer shapes
3042
+ * parameterise `Validator<Output, MyVerdict>` with their own type.
3043
+ *
3044
+ * Need structured extras? Extend DefaultVerdict with typed fields — never
3045
+ * serialize extras into `notes`.
3046
+ */
3047
+ interface DefaultVerdict {
3048
+ /** Whether the output meets the validator's pass criteria. */
3049
+ valid: boolean;
3050
+ /** Aggregate score in [0, 1]. Drivers use this for winner selection. */
3051
+ score: number;
3052
+ /** Per-dimension scores. Free-form; weighted into `score` by the validator. */
3053
+ scores?: Record<string, number>;
3054
+ /** Human-readable rationale; surfaces in trace + final-result `winner.verdict`. */
3055
+ notes?: string;
3056
+ }
3057
+
3058
+ /**
3059
+ * Verifiable reward channel.
3060
+ *
3061
+ * For RL on coding / math / theorem-proving / structured-output tasks, the
3062
+ * reward signal is *decidable* — a test passes or fails, a proof checks or
3063
+ * doesn't, an output validates against a schema or doesn't. These rewards
3064
+ * are dramatically more useful for RL training than LLM-judge scores
3065
+ * because they don't drift, can't be Goodhart-gamed by the policy in the
3066
+ * same way, and don't require a separate calibration loop.
3067
+ *
3068
+ * The `MultiLayerVerifier` already produces this signal — it just doesn't
3069
+ * surface it in a shape that's clean enough for RL training. This module
3070
+ * wraps the verifier output so consumers can:
3071
+ *
3072
+ * 1. Extract a clean `VerifiableReward` from a `VerificationReport`
3073
+ * 2. Distinguish *deterministic* rewards (compile, test, schema) from
3074
+ * *probabilistic* rewards (judge) so they can be weighted differently
3075
+ * in the RL training step
3076
+ * 3. Filter `RunRecord[]` to only those with a verifiable reward,
3077
+ * producing the clean training set that DeepSeek-R1-style GRPO and
3078
+ * AlphaProof-style search both depend on
3079
+ *
3080
+ * Why this matters: every credible 2025-2026 frontier RL result on coding
3081
+ * agents leans on verifiable reward (DeepSeek-R1 GRPO on test pass-rate,
3082
+ * o-series RL on math/code, AlphaProof on Lean kernel checking). Mixing
3083
+ * judge scores into the reward signal poisons the gradient. This module
3084
+ * is the seam.
3085
+ */
3086
+
3087
+ type VerifiableRewardSource = 'compile' | 'test' | 'schema' | 'sandbox' | 'judge' | 'composite';
3088
+ interface VerifiableRewardExtractionOptions {
3089
+ /**
3090
+ * Which layers count as deterministic-reward sources. The verifier doesn't
3091
+ * tag layers as "this is verifiable"; the caller declares it via this list
3092
+ * (or via the layer name → source mapping). Default treats common names
3093
+ * (`install`, `typecheck`, `build`, `lint`, `test`, `compile`, `schema`,
3094
+ * `sandbox`) as deterministic.
3095
+ */
3096
+ deterministicLayers?: string[];
3097
+ /**
3098
+ * Map layer name → reward source. Defaults to a sensible string-match.
3099
+ */
3100
+ sourceFor?: (layerName: string) => VerifiableRewardSource;
3101
+ /**
3102
+ * Whether to fall back to a probabilistic (judge) reward when no
3103
+ * deterministic layer produced a numeric score. Default `true`. Set to
3104
+ * `false` for "deterministic-only" training pipelines that should
3105
+ * discard runs without a verifiable signal.
3106
+ */
3107
+ fallbackToJudge?: boolean;
3108
+ /**
3109
+ * Default confidence for probabilistic (judge) rewards when the judge
3110
+ * doesn't report one. Default `0.7`.
3111
+ */
3112
+ judgeConfidenceFloor?: number;
3113
+ }
3114
+
3115
+ /**
3116
+ * Reward hacking / Goodhart detection.
3117
+ *
3118
+ * Goodhart's Law says: when a measure becomes a target, it ceases to be
3119
+ * a good measure. In RLHF and agentic-RL settings this is the dominant
3120
+ * failure mode — the policy learns to produce outputs that score well on
3121
+ * the proxy reward (judge, rubric, test pass-rate) without producing
3122
+ * the underlying capability the proxy was meant to track.
3123
+ *
3124
+ * Krakovna et al. (2020, "Specification Gaming Examples in AI") and the
3125
+ * subsequent RLHF reward-hacking literature (Skalse et al. 2022, Kim et al.
3126
+ * 2023) converge on a few diagnostic signatures:
3127
+ *
3128
+ * 1. **Reward divergence:** the proxy reward grows while the held-out
3129
+ * ground-truth signal stagnates or drops. Predictive validity over
3130
+ * time captures this.
3131
+ * 2. **Distributional shift in outputs:** after RL, the policy produces
3132
+ * outputs that no longer match the reference distribution — usually
3133
+ * because it found a high-reward attractor that's degenerate (e.g.
3134
+ * one-token responses, repetition, formatting tricks).
3135
+ * 3. **Disagreement between independent rewards:** if you train on
3136
+ * reward A and a held-out independent reward B drops sharply, you're
3137
+ * probably hacking A.
3138
+ * 4. **Calibration drift:** the verifiable / deterministic component of
3139
+ * the reward is stable; the probabilistic / judge component drifts up
3140
+ * while the deterministic component doesn't. The judge is being
3141
+ * gamed.
3142
+ *
3143
+ * This module ships explicit detectors for all four signatures, plus a
3144
+ * combined verdict. The output is diagnostic — actionable signals,
3145
+ * not autoreject — because each signature has known false positives
3146
+ * (e.g., a policy that genuinely improves can show distributional shift).
3147
+ *
3148
+ * Differs from `rubricPredictiveValidity` (which is a *standing* check on
3149
+ * whether rubrics correlate with deployment outcomes) — this is a
3150
+ * *temporal* check on whether the reward-vs-truth gap is *widening over
3151
+ * time during a training run*.
3152
+ */
3153
+
3154
+ interface DetectRewardHackingInput {
3155
+ /**
3156
+ * Run records ordered by recency (oldest first). The detector segments
3157
+ * them into prefix/suffix windows to compute "did the gap widen."
3158
+ */
3159
+ runs: RunRecord[];
3160
+ /**
3161
+ * The metric the policy was trained to optimize. Should be present on
3162
+ * `outcome.raw` or `outcome.holdoutScore`. Default reads `outcome.holdoutScore`.
3163
+ */
3164
+ proxyOf?: (run: RunRecord) => number | null;
3165
+ /**
3166
+ * The held-out ground-truth metric. For RL on coding, this is typically
3167
+ * test pass-rate. For RLHF, it's downstream task performance or human
3168
+ * preference. For knowledge tasks, it's an independently-graded score.
3169
+ */
3170
+ truthOf?: (run: RunRecord) => number | null;
3171
+ /**
3172
+ * Independent secondary reward. Used for the `reward_disagreement`
3173
+ * signal. Default uses the verifiable reward extractor (deterministic
3174
+ * sources only).
3175
+ */
3176
+ secondaryRewardOf?: (run: RunRecord) => number | null;
3177
+ /**
3178
+ * Window size — how many of the most recent runs count as the "after"
3179
+ * cohort. Default min(50, half the runs).
3180
+ */
3181
+ windowSize?: number;
3182
+ /**
3183
+ * Severity threshold to flag a signal. Default 0.3 (suspect) and 0.6
3184
+ * (gaming).
3185
+ */
3186
+ thresholds?: {
3187
+ suspect?: number;
3188
+ gaming?: number;
3189
+ };
3190
+ /**
3191
+ * Verifiable-reward options used for the secondary-reward fallback.
3192
+ */
3193
+ verifiableRewardOptions?: VerifiableRewardExtractionOptions;
3194
+ }
3195
+
2930
3196
  /**
2931
3197
  * `defaultProductionGate` — composes the substrate's existing safety
2932
3198
  * primitives (red-team / reward-hacking / canary / heldout) into a single
@@ -2939,6 +3205,10 @@ interface RedTeamCase extends DatasetScenario {
2939
3205
  * extra domain-specific gates they need (`composeGate(defaultProductionGate(...), customGate)`).
2940
3206
  */
2941
3207
 
3208
+ type DefaultProductionGateCheck = 'dimension-regression' | 'budget' | 'red-team' | 'reward-hacking' | 'canary';
3209
+ type DefaultProductionRewardHackingOptions = Omit<DetectRewardHackingInput, 'runs' | 'truthOf'> & {
3210
+ truthOf: NonNullable<DetectRewardHackingInput['truthOf']>;
3211
+ };
2942
3212
  interface DefaultProductionGateOptions {
2943
3213
  /** Required: scenarios held out from training; substrate compares
2944
3214
  * candidate-on-holdout vs baseline-on-holdout. */
@@ -2971,19 +3241,25 @@ interface DefaultProductionGateOptions {
2971
3241
  * native scale. When omitted it auto-scales off observed magnitudes:
2972
3242
  * 0.05 on [0,1], 5 on 0-100. */
2973
3243
  regressionTolerance?: number;
2974
- /** Total $ budget for ALL cells in this campaign — including baseline + candidate.
2975
- * Composite verdict refuses to ship when spend exceeded budget. */
3244
+ /** Total $ budget for the complete improvement run. Requires
3245
+ * `GateContext.costLedger`; missing or incomplete accounting holds. */
2976
3246
  budgetUsd?: number;
2977
- /** Red-team cases to probe candidate outputs against. When omitted the
2978
- * substrate uses `DEFAULT_RED_TEAM_CORPUS`. Provide a domain-specific
2979
- * battery for tighter coverage. */
3247
+ /** Static artifact-screening cases. Only `expected: 'ignore'` cases without
3248
+ * tool assertions are valid because this check does not dispatch case inputs
3249
+ * or observe tool calls. */
2980
3250
  redTeamBattery?: RedTeamCase[];
2981
- /** Run records (oldest-first) needed for the reward-hacking detector.
2982
- * Substrate populates from prior production-loop generations. */
3251
+ /** Shared run history, oldest first. Supplying history does not enable either
3252
+ * monitoring check; configure `rewardHacking` and/or `canary` explicitly. */
2983
3253
  recentRuns?: RunRecord[];
2984
- /** When true, the gate refuses to ship if the reward-hacking detector
2985
- * fires at the `gaming` severity. Default true. */
2986
- blockOnRewardHackingGaming?: boolean;
3254
+ /** Enable reward-hacking monitoring with a caller-owned independent truth channel. */
3255
+ rewardHacking?: DefaultProductionRewardHackingOptions;
3256
+ /** Enable canary monitoring. Pass `{}` to use the canary defaults. */
3257
+ canary?: CanaryOptions;
3258
+ /** Optional checks that must be evaluated even when their normal input is
3259
+ * absent. Configuring a check's input also makes that check required.
3260
+ * Missing evidence always records `not_evaluated`; required unevaluated
3261
+ * checks hold the release decision. Held-out significance is always required. */
3262
+ requiredChecks?: DefaultProductionGateCheck[];
2987
3263
  }
2988
3264
  /**
2989
3265
  * Opinionated production gate composing held-out significance, red-team, reward-hacking, and canary checks into a single `Gate.decide` decision.
@@ -3902,40 +4178,6 @@ interface Artifact {
3902
4178
  metadata?: Record<string, unknown>;
3903
4179
  }
3904
4180
 
3905
- /**
3906
- * Validator-output verdict — substrate primitive for "did this output pass,
3907
- * and how well?"
3908
- *
3909
- * Used by:
3910
- * - `@tangle-network/agent-eval/matrix` — verdict per cell in the cartesian.
3911
- * - `@tangle-network/agent-runtime` — Validator<Output, Verdict = DefaultVerdict>.
3912
- * Runtime keeps `Validator` because it's coupled to runtime-shaped
3913
- * `ValidationCtx` (iteration, signal, traceEmitter); the verdict TYPE
3914
- * itself is a substrate concept and lives here.
3915
- *
3916
- * Repo layering: agent-eval is the substrate (no upward deps). Both
3917
- * agent-runtime and agent-knowledge consume this type FROM agent-eval —
3918
- * never the other way around. See CLAUDE.md "Repo layering" for the rule.
3919
- */
3920
- /**
3921
- * Minimal verdict shape — `valid` + `score` are required; `scores` +
3922
- * `notes` are optional surface. Validators that need richer shapes
3923
- * parameterise `Validator<Output, MyVerdict>` with their own type.
3924
- *
3925
- * Need structured extras? Extend DefaultVerdict with typed fields — never
3926
- * serialize extras into `notes`.
3927
- */
3928
- interface DefaultVerdict {
3929
- /** Whether the output meets the validator's pass criteria. */
3930
- valid: boolean;
3931
- /** Aggregate score in [0, 1]. Drivers use this for winner selection. */
3932
- score: number;
3933
- /** Per-dimension scores. Free-form; weighted into `score` by the validator. */
3934
- scores?: Record<string, number>;
3935
- /** Human-readable rationale; surfaces in trace + final-result `winner.verdict`. */
3936
- notes?: string;
3937
- }
3938
-
3939
4181
  /**
3940
4182
  * Completion verifier — the task-completion oracle.
3941
4183
  *
@@ -4251,8 +4493,8 @@ interface ProfileSummary {
4251
4493
  model: string;
4252
4494
  /** RunRecords produced for this profile (= scenarios × reps). */
4253
4495
  records: number;
4254
- /** Mean composite across this profile's records. */
4255
- meanComposite: number;
4496
+ /** Mean across scored records, or null when the profile has no task labels. */
4497
+ meanComposite: number | null;
4256
4498
  totalCostUsd: number;
4257
4499
  /** Per-profile integrity verdict — surfaces a single profile that ran stub
4258
4500
  * even when the matrix as a whole looks real. */
@@ -4480,7 +4722,7 @@ interface RunOptimizationBaseOptions<TScenario extends Scenario, TArtifact> exte
4480
4722
  candidates: Array<{
4481
4723
  surfaceHash: string;
4482
4724
  campaign: CampaignResult<TArtifact, TScenario>;
4483
- composite: number;
4725
+ composite: number | null;
4484
4726
  }>;
4485
4727
  history: GenerationRecord[];
4486
4728
  /** Shared run spend account and receipt attribution phase. */
@@ -4641,7 +4883,7 @@ interface ParetoPoint {
4641
4883
  onFrontier: boolean;
4642
4884
  /** Optional gate verdict for this candidate, if a `GateDecision`
4643
4885
  * for it was passed in. */
4644
- gate?: 'promote' | 'reject_few_runs' | 'reject_negative_delta' | 'reject_overfit_gap' | null;
4886
+ gate?: 'promote' | 'reject';
4645
4887
  }
4646
4888
  interface ParetoFigureSpec {
4647
4889
  kind: 'pareto-cost-quality';
@@ -4695,8 +4937,8 @@ interface InsightReport {
4695
4937
  /** Number of runs analyzed. */
4696
4938
  n: number;
4697
4939
  /** Runtime facts carried by the run records. These describe execution,
4698
- * not task quality: duration, queueing, token categories, models, and
4699
- * explicitly recorded failures. */
4940
+ * not task quality: duration, queueing, token categories, models,
4941
+ * execution errors, and terminal outcomes. */
4700
4942
  execution: ExecutionInsight;
4701
4943
  /** Composite-score distribution across all runs. Always present. */
4702
4944
  composite: ScalarDistribution;
@@ -4754,11 +4996,10 @@ interface InsightReport {
4754
4996
  * Surfaced metrics: composite, cost, duration, tokenUsage, plus any
4755
4997
  * per-dimension judge metric present in both windows. */
4756
4998
  priorPeriodComparison?: PriorPeriodComparison;
4757
- /** Model-free failure-mode breakdown from `RunRecord.failureMode`, ranked
4758
- * by count descending. Present when any run carries a `failureMode`.
4759
- * Complements `failureClusters` (LLM-semantic) with the structured tags
4760
- * the harness already recorded — actionable with no analyst wired. */
4761
- failureModes?: FailureModeTally[];
4999
+ /** Model-free task-failure breakdown from `RunRecord.failureClass`, ranked
5000
+ * by count descending. Domain-specific `failureMode` detail is retained on
5001
+ * each record but never creates a second aggregation vocabulary. */
5002
+ failureClasses?: FailureClassTally[];
4762
5003
  /** Top-N actionable recommendations, ranked by priority. The packet's
4763
5004
  * human-readable layer; the numeric sections are the evidence. */
4764
5005
  recommendations: Recommendation[];
@@ -4806,14 +5047,45 @@ interface ExecutionInsight {
4806
5047
  events: number;
4807
5048
  reportingRuns: number;
4808
5049
  };
4809
- /** Failure counts remain separate from outcome scores. `reportedErrorEvents`
4810
- * sums `outcome.raw.error_span_count` only where a producer supplied it. */
4811
- failures: {
5050
+ /** Runs with explicit execution-error telemetry. This is independent of
5051
+ * whether the root run ultimately succeeded, failed, or has no terminal
5052
+ * evidence. */
5053
+ executionErrors: {
4812
5054
  runs: number;
4813
- fraction: number;
4814
- reportedErrorEvents: number;
5055
+ /** Share among runs that supplied an execution-error count.
5056
+ * `null` when no run supplied error telemetry. */
5057
+ fraction: number | null;
5058
+ /** Execution-error events reported through the canonical count. */
5059
+ events: number;
5060
+ /** Runs that supplied an execution-error count, including explicit zeroes. */
4815
5061
  reportingRuns: number;
5062
+ /** Exact sum of `outcome.raw.error_span_count`, kept separate from other errors. */
5063
+ errorSpanEvents: number;
5064
+ /** Runs that supplied `outcome.raw.error_span_count`, including explicit zeroes. */
5065
+ errorSpanReportingRuns: number;
5066
+ /**
5067
+ * Error-telemetry coverage crossed with independently reported terminal
5068
+ * outcomes. `unreported` is distinct from a reported zero.
5069
+ */
5070
+ byTerminalOutcome: Record<RunTerminalOutcome, ExecutionErrorOutcomeCell>;
4816
5071
  };
5072
+ /** Root-run or process outcomes. Missing `RunRecord.terminalOutcome` values
5073
+ * count as `unknown`; child-span status never changes these counts. */
5074
+ terminalOutcomes: {
5075
+ succeeded: number;
5076
+ failed: number;
5077
+ cancelled: number;
5078
+ incomplete: number;
5079
+ unknown: number;
5080
+ };
5081
+ }
5082
+ interface ExecutionErrorOutcomeCell {
5083
+ /** Runs that explicitly reported one or more execution errors. */
5084
+ withErrors: number;
5085
+ /** Runs that explicitly reported zero execution errors. */
5086
+ withoutErrors: number;
5087
+ /** Runs with no execution-error count from the producer. */
5088
+ unreported: number;
4817
5089
  }
4818
5090
  interface TokenUsageInsight {
4819
5091
  input: ScalarDistribution;
@@ -4833,12 +5105,18 @@ interface TokenUsageInsight {
4833
5105
  interface ScalarDistribution {
4834
5106
  /** Sample count after dropping non-finite values. */
4835
5107
  n: number;
4836
- mean: number;
4837
- p50: number;
4838
- p95: number;
4839
- stddev: number;
4840
- min: number;
4841
- max: number;
5108
+ /** Null when `n` is zero. */
5109
+ mean: number | null;
5110
+ /** Null when `n` is zero. */
5111
+ p50: number | null;
5112
+ /** Null when `n` is zero. */
5113
+ p95: number | null;
5114
+ /** Null when `n` is zero. */
5115
+ stddev: number | null;
5116
+ /** Null when `n` is zero. */
5117
+ min: number | null;
5118
+ /** Null when `n` is zero. */
5119
+ max: number | null;
4842
5120
  /** Histogram bins using `agent-eval`'s `gainHistogram` primitive. */
4843
5121
  histogram: GainDistributionBin[];
4844
5122
  /** Worst-N runs by score, ascending. Populated for the composite
@@ -4904,12 +5182,16 @@ interface LiftInsight {
4904
5182
  pValue: number;
4905
5183
  /** Number of paired observations. */
4906
5184
  n: number;
4907
- /** Cohen's d for the delta. */
4908
- cohensD: number;
5185
+ /** Scored baseline observations without a candidate match. */
5186
+ unpairedBaseline: number;
5187
+ /** Scored candidate observations without a baseline match. */
5188
+ unpairedCandidate: number;
5189
+ /** Cohen's dz for paired deltas; null when the observed delta variance is zero. */
5190
+ cohensD: number | null;
4909
5191
  /** Minimum detectable effect at current n, 80% power. */
4910
5192
  mde: number;
4911
- /** Sample size needed to detect the observed delta at 80% power. */
4912
- requiredN: number;
5193
+ /** Paired sample size needed to detect the standardized effect at 80% power. */
5194
+ requiredN: number | null;
4913
5195
  }
4914
5196
  interface FailureClusterInsight {
4915
5197
  /** All clusters identified by the registry, ranked by share descending. */
@@ -4925,15 +5207,13 @@ interface FailureClusterInsight {
4925
5207
  }>;
4926
5208
  totalFailures: number;
4927
5209
  }
4928
- /** Model-free failure breakdown over the structured `RunRecord.failureMode`
4929
- * enum. Unlike `failureClusters` (semantic, requires an LLM analyst), this
4930
- * is computed directly from the tags the harness already recorded — so a
4931
- * customer ingesting one batch with no judge/analyst still learns which
4932
- * named failure dominates. */
4933
- interface FailureModeTally {
4934
- /** The `failureMode` tag. */
4935
- mode: string;
4936
- /** Number of runs carrying this tag. */
5210
+ /** Model-free task-failure breakdown over canonical `RunRecord.failureClass`
5211
+ * values. Unlike semantic failure clusters, this is computed directly from
5212
+ * run records and does not require a model analyst. */
5213
+ interface FailureClassTally {
5214
+ /** Canonical task-failure class. */
5215
+ failureClass: FailureClass;
5216
+ /** Number of failed runs carrying this class. */
4937
5217
  count: number;
4938
5218
  /** Share of the whole corpus, 0..1. */
4939
5219
  share: number;
@@ -4973,7 +5253,7 @@ interface ReleaseSummary {
4973
5253
  status: 'pass' | 'warn' | 'fail';
4974
5254
  axes: Array<{
4975
5255
  name: 'quality-lift' | 'contamination' | 'composite-distribution';
4976
- status: 'pass' | 'warn' | 'fail';
5256
+ status: 'pass' | 'warn' | 'fail' | 'not_evaluated';
4977
5257
  detail: string;
4978
5258
  }>;
4979
5259
  /** Free-form issues surfaced beyond the standard axes. Empty by default;
@@ -5033,9 +5313,8 @@ interface Recommendation {
5033
5313
  * # Hosted-tier wire format — the schema that EVERY orchestrator (ours,
5034
5314
  * a partner's self-hosted one, a future open implementation) must accept.
5035
5315
  *
5036
- * **Stability:** every type in this file is committed under semver. New
5037
- * minors only ADD optional fields. Breaking changes mean a major bump
5038
- * (`HostedWireVersion` literal increment).
5316
+ * This package implements exactly one wire version. Servers reject every
5317
+ * other version instead of translating old payloads.
5039
5318
  *
5040
5319
  * The wire format is two event streams in one transport:
5041
5320
  *
@@ -5054,7 +5333,7 @@ interface Recommendation {
5054
5333
  * ever sees another tenant's data.
5055
5334
  */
5056
5335
 
5057
- declare const HOSTED_WIRE_VERSION: "2026-05-26.v1";
5336
+ declare const HOSTED_WIRE_VERSION: "2026-07-24.v1";
5058
5337
  type HostedWireVersion = typeof HOSTED_WIRE_VERSION;
5059
5338
  /** Lifecycle stages of an eval-run as the substrate reports them. */
5060
5339
  type EvalRunStatus = 'started' | 'baseline-complete' | 'generation-complete' | 'gate-decided' | 'finished' | 'errored';
@@ -5063,11 +5342,15 @@ interface EvalRunCellScore {
5063
5342
  scenarioId: string;
5064
5343
  /** Repetition index when reps > 1; 0 for the default. */
5065
5344
  rep: number;
5066
- /** Composite score across all judges + dimensions for this cell. */
5067
- compositeMean: number;
5068
- /** Per-judge per-dimension scores; null where the judge did not run. */
5345
+ /** Composite score across successful judges, or null when unscored. */
5346
+ compositeMean: number | null;
5347
+ /** Per-judge and per-dimension scores; failed or missing judges are absent. */
5069
5348
  dimensions: Record<string, Record<string, number>>;
5070
- /** Per-cell error message if the dispatch threw. Null on success. */
5349
+ /** Root execution result, kept separate from task quality. */
5350
+ terminalOutcome: RunTerminalOutcome;
5351
+ /** Canonical execution-error count, or null when the producer did not measure it. */
5352
+ executionErrorCount: number | null;
5353
+ /** Per-cell dispatch or judge error. Missing on success. */
5071
5354
  errorMessage?: string;
5072
5355
  }
5073
5356
  interface EvalRunGenerationSnapshot {
@@ -5081,8 +5364,8 @@ interface EvalRunGenerationSnapshot {
5081
5364
  surface?: MutableSurface;
5082
5365
  /** Per-cell scores for this generation. */
5083
5366
  cells: EvalRunCellScore[];
5084
- /** Aggregate composite mean across all cells in this generation. */
5085
- compositeMean: number;
5367
+ /** Mean across scored cells, or null when no cell has a task-quality label. */
5368
+ compositeMean: number | null;
5086
5369
  /** Total $ spent across this generation. */
5087
5370
  costUsd: number;
5088
5371
  /** Wall-clock duration of this generation. */
@@ -5122,10 +5405,14 @@ interface EvalRunEvent {
5122
5405
  * paired-bootstrap lift CI, judge stats, inter-rater agreement,
5123
5406
  * contamination check, failure clusters (when an analyst is wired),
5124
5407
  * outcome correlation (when downstream signal is supplied), and the
5125
- * recommendations the dashboard surfaces verbatim. Additive; older
5126
- * clients that don't know about this field continue to work. */
5408
+ * recommendations the dashboard surfaces verbatim. */
5127
5409
  insightReport?: InsightReport;
5128
5410
  }
5411
+ /**
5412
+ * Canonical unsigned 64-bit integer encoded as a base-10 string.
5413
+ * JSON numbers cannot represent OTLP nanosecond timestamps exactly.
5414
+ */
5415
+ type UnixNanoTimestamp = string;
5129
5416
  /**
5130
5417
  * OTel-shape span with a few additional attributes for eval-run pivoting.
5131
5418
  * Compatible with any OTLP collector — `name`, `traceId`, `spanId`,
@@ -5136,11 +5423,11 @@ interface TraceSpanEvent {
5136
5423
  spanId: string;
5137
5424
  parentSpanId?: string;
5138
5425
  name: string;
5139
- startTimeUnixNano: number;
5140
- endTimeUnixNano: number;
5426
+ startTimeUnixNano: UnixNanoTimestamp;
5427
+ endTimeUnixNano: UnixNanoTimestamp;
5141
5428
  attributes: Record<string, string | number | boolean>;
5142
5429
  events?: Array<{
5143
- timeUnixNano: number;
5430
+ timeUnixNano: UnixNanoTimestamp;
5144
5431
  name: string;
5145
5432
  attributes?: Record<string, string | number | boolean>;
5146
5433
  }>;
@@ -5257,8 +5544,8 @@ interface LoopProvenanceCandidate {
5257
5544
  eligibleForPromotion: boolean;
5258
5545
  /** Designed-denominator receipt retained even for incomplete candidates. */
5259
5546
  coverage: NonNullable<GenerationCandidate['coverage']>;
5260
- /** Mean composite this candidate scored on the search split. */
5261
- composite: number;
5547
+ /** Mean composite this candidate scored on the search split, or null when unscorable. */
5548
+ composite: number | null;
5262
5549
  /** Whether this candidate was promoted out of its generation. */
5263
5550
  promoted: boolean;
5264
5551
  }
@@ -5330,11 +5617,7 @@ interface LoopProvenanceRecord {
5330
5617
  decision: GateDecision;
5331
5618
  reasons: string[];
5332
5619
  delta?: number;
5333
- contributingGates: Array<{
5334
- name: string;
5335
- passed: boolean;
5336
- detail: unknown;
5337
- }>;
5620
+ contributingGates: GateContribution[];
5338
5621
  };
5339
5622
  /** Present iff the loop ran with `holdout: 'deferred'` — the held-out
5340
5623
  * comparison was intentionally not measured in this run, so the holdout
@@ -5529,11 +5812,9 @@ declare function selectDiscriminative(signals: ScenarioSignal[], k: number, opts
5529
5812
  * the optimizers cannot drift on how a surface's score is computed.
5530
5813
  */
5531
5814
 
5532
- /** Mean composite across a campaign: per cell, the mean of its finite,
5533
- * successful judge composites; then the mean across cells. Invalid scores
5534
- * remain visible on raw cells and coverage receipts but never poison the
5535
- * descriptive aggregate with NaN. Cells with no valid scores are skipped.
5536
- * Empty ⇒ 0. */
5815
+ /** Mean composite across cells with complete task-quality evidence.
5816
+ * Partial judge results remain on their cells but never enter this value.
5817
+ * A campaign with no complete score has no numeric mean and fails loudly. */
5537
5818
  declare function campaignMeanComposite<TArtifact, TScenario extends Scenario>(campaign: CampaignResult<TArtifact, TScenario>): number;
5538
5819
  /** Compare fixed-length lexicographic rank keys where each element is higher-is-better.
5539
5820
  * Returns a positive number when `a` ranks above `b`, negative when below, and
@@ -6106,4 +6387,4 @@ declare function verifyCodeSurface(surface: CodeSurface, worktreeDir?: string):
6106
6387
  * identity against the checkout at `worktreeRef`. */
6107
6388
  declare function resolveWorktreePath(surface: CodeSurface, worktreeDir?: string): string;
6108
6389
 
6109
- export { type AnalystArtifact, type AnalystScenario, type AnalyzeCrossSurfaceInteractionsInput, type AxisEvidence, type AxisVerdict, type BuildAnalystSurfaceDispatchOptions, type BuildEvidenceVectorOptions, type BuildLoopProvenanceArgs, type CampaignAggregates, type CampaignArtifactWriter, type CampaignBreakdown, type CampaignCellFailureReceipt, type CampaignCellResult, type CampaignCostMeter, type CampaignResult, type CampaignRunPlan, type CampaignRunPlanCell, type CampaignScenarioIdentity, type CampaignStorage, type CampaignTokenUsage, type CampaignTraceWriter, type CodeSurface, type CodeSurfaceVerification, type CompareOptimizationMethodsOptions, type ComparisonCost, type ComponentSurface, type CostLedgerHandle, type CrossSurfaceAdditionDecision, type CrossSurfaceAdditionRejectionReason, type CrossSurfaceAttemptCompleteness, type CrossSurfaceBestSingleSelection, type CrossSurfaceBootstrapPolicy, type CrossSurfaceCandidate, type CrossSurfaceCandidateComparison, type CrossSurfaceCandidateEvidence, type CrossSurfaceCandidateOutcome, type CrossSurfaceCandidateSummary, type CrossSurfaceComponent, type CrossSurfaceComponentEvidence, type CrossSurfaceCompositionStep, type CrossSurfaceDistribution, type CrossSurfaceEligibility, type CrossSurfaceEvidenceBreakdown, type CrossSurfaceIneligibilityReason, type CrossSurfaceInteractionAwareSelection, type CrossSurfaceInteractionEffect, type CrossSurfaceInteractionPath, type CrossSurfaceInteractionReport, type CrossSurfaceInteractionTask, type CrossSurfaceNaiveStackSelection, type CrossSurfacePairCompatibility, type CrossSurfacePairEvidence, type CrossSurfacePairIncompatibilityReason, type CrossSurfacePairwiseEntry, type CrossSurfaceRankedSingle, type CrossSurfaceRelativeCost, type CrossSurfaceSelectionPolicy, type CrossSurfaceSelections, type CrossSurfaceTaskRow, type DefaultProductionGateOptions, type DimensionRegression, type DiscriminationScore, type DispatchContext, type DispatchFn, type EmitLoopProvenanceArgs, type EmitLoopProvenanceResult, type EvalFixture, type EvalFixtureFile, type EvalFixtureLoadOptions, type EvalFixtureRunPlan, type EvalFixtureScenario, type EvalFixtureValidationMode, type EvidenceVector, type ExternalOptimizationExample, type ExternalTextEvaluationResponse, type ExternalTextOptimizationMethodConfig, type ExternalTextOptimizerContext, type ExternalTextOptimizerResult, type FailureModeRecallJudgeOptions, FileSearchLedger, FsLabeledScenarioStore, type FsLabeledScenarioStoreOptions, type Gate, type GateContext, type GateDecision, type GateResult, type GenerationCandidate, type GenerationRecord, type GepaAdaptiveEngineRun, type GepaEngineOptions, type GepaEngineRun, type GepaOptimizationMethodConfig, type GepaOptimizationRecipe, type GepaRunnerCommand, type GitWorktreeAdapterOptions, type HeldOutGateOptions, type HeldoutSignificance, type HeldoutSignificanceOptions, type JudgeAggregate, type JudgeConfig, type JudgeDimension, type JudgeScore, type LabelTrust, type LabeledScenarioRecord, type LabeledScenarioSampleArgs, type LabeledScenarioSource, type LabeledScenarioStore, LabeledScenarioStoreError, type LabeledScenarioWrite, type LlmJudgeDimension, type LlmJudgeOptions, type LoadEvalFixtureScenariosOptions, type LoopProvenanceArgsFromResult, type LoopProvenanceBackend, type LoopProvenanceCandidate, type LoopProvenanceEvidence, type LoopProvenanceOptimizationMethod, type LoopProvenanceRecord, type MutableSurface, type NeutralizationGateOptions, type ObjectiveSource, type OpenAICompatibleOptimizerModel, type OpenAutoPrOptions, type OpenAutoPrResult, type OpenSearchLedgerOptions, type OptimizationMethod, type OptimizationMethodComparison, type OptimizationMethodInput, type OptimizationMethodPairwise, type OptimizationMethodProvenance, type OptimizationMethodResult, type OptimizationMethodRunOptions, type OptimizationMethodScore, type OptimizationPackageSource, type OptimizationProposer, type OptimizationTokenUsage, type OptimizerConfig, type OptimizerModelBudget, type PairedHoldout, type ParetoParent, type ParetoSignificanceGateOptions, type PendingCostCallView, type PlanCampaignRunOptions, type PlanEvalFixtureRunOptions, type PlaybackContext, type PlaybackDriver, type PlaybackStep, type PowerPreflight, type PowerPreflightOptions, type PremeasuredOptimizationBaseline, type ProfileDispatchFn, ProfileMatrixError, type ProfileSummary, type PromotionObjective, type PromotionPolicy, type ProposalTrackContext, type ProposeContext, type ProposedCandidate, type RedactionStatus, type ReferenceEquivalenceJudgeOptions, type ReferenceEquivalenceScenario, type RolloutArgumentDiff, type RolloutArgumentDiffOptions, type RolloutCall, type RunCampaignOptions, type RunEvalOptions, type RunImprovementLoopOptions, type RunImprovementLoopResult, type RunOptimizationOptions, type RunOptimizationResult, type RunProfileMatrixOptions, type RunProfileMatrixResult, SEARCH_LEDGER_SCHEMA, type Scenario, type ScenarioAggregate, type ScenarioRollup, type ScenarioSignal, type ScoreboardRenderOptions, type ScoreboardRow, type ScoreboardSummary, type ScoredRollout, type ScoredSurfaceOutcome, type SearchAccountingAudit, type SearchArtifactRef, type SearchAttemptAccounting, type SearchCandidateDecidedEvent, type SearchCandidateLineage, type SearchCandidateRegisteredEvent, type SearchCandidateSlot, type SearchCandidateSlotClosedEvent, type SearchCandidateSurface, type SearchCompletedEvent, type SearchCostAccounting, type SearchFailureReason, type SearchLedger, type SearchLedgerAppendResult, SearchLedgerConflictError, type SearchLedgerEntry, SearchLedgerError, type SearchLedgerEvent, type SearchLedgerHash, SearchLedgerIntegrityError, type SearchLedgerReplay, type SearchModelIdentity, type SearchOperationKind, type SearchOperationRecordedEvent, type SearchPlan, type SearchPlannedEvent, type SearchPlannedOperation, type SearchPlannedTask, type SearchSourceRef, type SearchSurfaceEffect, type SearchSurfaceEvidence, type SearchSurfaceKind, type SearchTaskAttemptedEvent, type SearchTaskOutcome, type SearchTokenAccounting, type SequentialDecideFn, type SequentialDecideOptions, type SequentialDecision, type SequentialObservation, type SequentialPairedGate, type SequentialPairedGateOptions, type SessionScript, type SingleRunLock, type SingleRunLockOptions, type SkillOptOptimizationMethodConfig, type SkillOptRunnerCommand, type SkillOptTrainerConfig, type SurfaceProposer, type TraceSpan, type TransientFailureOptions, type UngroundedLiteralReport, type UserStory, type UserStoryVerdict, type Worktree, type WorktreeAdapter, WorktreeAdapterError, acquireSingleRunLock, analyzeCrossSurfaceInteractions, assertCampaignDesign, assertCampaignSplitIdentity, assertCodeSurfaceIdentity, assertComponentSurface, buildAnalystSurfaceDispatch, buildEvidenceVector, buildLoopProvenanceRecord, campaignBreakdown, campaignMeanComposite, campaignMeasurementDigest, campaignScenarioIdentity, campaignSplitDigest, campaignSplitDigestFromIdentities, canonicalDigest, classifyUngroundedLiterals, codeSurfaceIdentityMaterial, compareOptimizationMethods, compareRankKeys, componentSurfaceIdentityMaterial, composeGate, costFromLedgerSummary, createReferenceEquivalenceJudge, createRunCostLedger, defaultProductionGate, detectScale, dimensionRegressions, discoverEvalFixtures, emitLoopProvenance, externalTextOptimizationMethod, failureModeRecallJudge, fsCampaignStorage, gepaOptimizationMethod, gitWorktreeAdapter, heldOutGate, heldoutSignificance, inMemoryCampaignStorage, isProposedCandidate, isTransientTransportFailure, labelTrustRank, llmJudge, loadEvalFixture, loadEvalFixtureScenarios, loopProvenanceArgsFromResult, loopProvenanceSpans, makePlaybackDispatch, neutralizationGate, neutralizeText, openAutoPr, openSearchLedger, optimizationTokenUsageFromSummary, pairHoldout, paretoPolicy, paretoSignificanceGate, planCampaignRun, planEvalFixtureRun, powerPreflight, provenanceRecordPath, provenanceSpansPath, renderScoreboardMarkdown, renderSurfaceDiff, resolveRunDir, resolveWorktreePath, rolloutArgumentDiff, runCampaign, runEval, runImprovementLoop, runOptimization, runProfileMatrix, scoreDiscrimination, scoreUserStory, scoreboardSummary, selectDiscriminative, sequentialDecide, sequentialPairedGate, skillOptOptimizationMethod, surfaceContentHash, surfaceHash, tangleTracesRoot, userStoryScoreboard, validateSearchLedgerEvent, verifyCodeSurface, verifyLoopProvenanceRecord };
6390
+ export { type AnalystArtifact, type AnalystScenario, type AnalyzeCrossSurfaceInteractionsInput, type AxisEvidence, type AxisVerdict, type BuildAnalystSurfaceDispatchOptions, type BuildEvidenceVectorOptions, type BuildLoopProvenanceArgs, type CampaignAggregates, type CampaignArtifactWriter, type CampaignBreakdown, type CampaignCellFailureReceipt, type CampaignCellResult, type CampaignCostMeter, type CampaignResult, type CampaignRunPlan, type CampaignRunPlanCell, type CampaignScenarioIdentity, type CampaignStorage, type CampaignTokenUsage, type CampaignTraceWriter, type CodeSurface, type CodeSurfaceVerification, type CompareOptimizationMethodsOptions, type ComparisonCost, type ComponentSurface, type CostLedgerHandle, type CrossSurfaceAdditionDecision, type CrossSurfaceAdditionRejectionReason, type CrossSurfaceAttemptCompleteness, type CrossSurfaceBestSingleSelection, type CrossSurfaceBootstrapPolicy, type CrossSurfaceCandidate, type CrossSurfaceCandidateComparison, type CrossSurfaceCandidateEvidence, type CrossSurfaceCandidateOutcome, type CrossSurfaceCandidateSummary, type CrossSurfaceComponent, type CrossSurfaceComponentEvidence, type CrossSurfaceCompositionStep, type CrossSurfaceDistribution, type CrossSurfaceEligibility, type CrossSurfaceEvidenceBreakdown, type CrossSurfaceIneligibilityReason, type CrossSurfaceInteractionAwareSelection, type CrossSurfaceInteractionEffect, type CrossSurfaceInteractionPath, type CrossSurfaceInteractionReport, type CrossSurfaceInteractionTask, type CrossSurfaceNaiveStackSelection, type CrossSurfacePairCompatibility, type CrossSurfacePairEvidence, type CrossSurfacePairIncompatibilityReason, type CrossSurfacePairwiseEntry, type CrossSurfaceRankedSingle, type CrossSurfaceRelativeCost, type CrossSurfaceSelectionPolicy, type CrossSurfaceSelections, type CrossSurfaceTaskRow, type DefaultProductionGateCheck, type DefaultProductionGateOptions, type DefaultProductionRewardHackingOptions, type DimensionRegression, type DiscriminationScore, type DispatchContext, type DispatchFn, type EmitLoopProvenanceArgs, type EmitLoopProvenanceResult, type EvalFixture, type EvalFixtureFile, type EvalFixtureLoadOptions, type EvalFixtureRunPlan, type EvalFixtureScenario, type EvalFixtureValidationMode, type EvidenceVector, type ExternalOptimizationExample, type ExternalTextEvaluationResponse, type ExternalTextOptimizationMethodConfig, type ExternalTextOptimizerContext, type ExternalTextOptimizerResult, type FailureModeRecallJudgeOptions, FileSearchLedger, FsLabeledScenarioStore, type FsLabeledScenarioStoreOptions, type Gate, type GateCheckStatus, type GateContext, type GateContribution, type GateDecision, type GateResult, type GenerationCandidate, type GenerationRecord, type GepaAdaptiveEngineRun, type GepaEngineOptions, type GepaEngineRun, type GepaOptimizationMethodConfig, type GepaOptimizationRecipe, type GepaRunnerCommand, type GitWorktreeAdapterOptions, type HeldOutGateOptions, type HeldoutSignificance, type HeldoutSignificanceOptions, type JudgeAggregate, type JudgeConfig, type JudgeDimension, type JudgeScore, type LabelTrust, type LabeledScenarioRecord, type LabeledScenarioSampleArgs, type LabeledScenarioSource, type LabeledScenarioStore, LabeledScenarioStoreError, type LabeledScenarioWrite, type LlmJudgeDimension, type LlmJudgeOptions, type LoadEvalFixtureScenariosOptions, type LoopProvenanceArgsFromResult, type LoopProvenanceBackend, type LoopProvenanceCandidate, type LoopProvenanceEvidence, type LoopProvenanceOptimizationMethod, type LoopProvenanceRecord, type MutableSurface, type NeutralizationGateOptions, type ObjectiveSource, type OpenAICompatibleOptimizerModel, type OpenAutoPrOptions, type OpenAutoPrResult, type OpenSearchLedgerOptions, type OptimizationMethod, type OptimizationMethodComparison, type OptimizationMethodInput, type OptimizationMethodPairwise, type OptimizationMethodProvenance, type OptimizationMethodResult, type OptimizationMethodRunOptions, type OptimizationMethodScore, type OptimizationPackageSource, type OptimizationProposer, type OptimizationTokenUsage, type OptimizerConfig, type OptimizerModelBudget, type PairedHoldout, type ParetoParent, type ParetoSignificanceGateOptions, type PendingCostCallView, type PlanCampaignRunOptions, type PlanEvalFixtureRunOptions, type PlaybackContext, type PlaybackDriver, type PlaybackStep, type PowerPreflight, type PowerPreflightOptions, type PremeasuredOptimizationBaseline, type ProfileDispatchFn, ProfileMatrixError, type ProfileSummary, type PromotionObjective, type PromotionPolicy, type ProposalTrackContext, type ProposeContext, type ProposedCandidate, type RedactionStatus, type ReferenceEquivalenceJudgeOptions, type ReferenceEquivalenceScenario, type RolloutArgumentDiff, type RolloutArgumentDiffOptions, type RolloutCall, type RunCampaignOptions, type RunEvalOptions, type RunImprovementLoopOptions, type RunImprovementLoopResult, type RunOptimizationOptions, type RunOptimizationResult, type RunProfileMatrixOptions, type RunProfileMatrixResult, SEARCH_LEDGER_SCHEMA, type Scenario, type ScenarioAggregate, type ScenarioRollup, type ScenarioSignal, type ScoreboardRenderOptions, type ScoreboardRow, type ScoreboardSummary, type ScoredRollout, type ScoredSurfaceOutcome, type SearchAccountingAudit, type SearchArtifactRef, type SearchAttemptAccounting, type SearchCandidateDecidedEvent, type SearchCandidateLineage, type SearchCandidateRegisteredEvent, type SearchCandidateSlot, type SearchCandidateSlotClosedEvent, type SearchCandidateSurface, type SearchCompletedEvent, type SearchCostAccounting, type SearchFailureReason, type SearchLedger, type SearchLedgerAppendResult, SearchLedgerConflictError, type SearchLedgerEntry, SearchLedgerError, type SearchLedgerEvent, type SearchLedgerHash, SearchLedgerIntegrityError, type SearchLedgerReplay, type SearchModelIdentity, type SearchOperationKind, type SearchOperationRecordedEvent, type SearchPlan, type SearchPlannedEvent, type SearchPlannedOperation, type SearchPlannedTask, type SearchSourceRef, type SearchSurfaceEffect, type SearchSurfaceEvidence, type SearchSurfaceKind, type SearchTaskAttemptedEvent, type SearchTaskOutcome, type SearchTokenAccounting, type SequentialDecideFn, type SequentialDecideOptions, type SequentialDecision, type SequentialObservation, type SequentialPairedGate, type SequentialPairedGateOptions, type SessionScript, type SingleRunLock, type SingleRunLockOptions, type SkillOptOptimizationMethodConfig, type SkillOptRunnerCommand, type SkillOptTrainerConfig, type SurfaceProposer, type TraceSpan, type TransientFailureOptions, type UngroundedLiteralReport, type UserStory, type UserStoryVerdict, type Worktree, type WorktreeAdapter, WorktreeAdapterError, acquireSingleRunLock, analyzeCrossSurfaceInteractions, assertCampaignDesign, assertCampaignSplitIdentity, assertCodeSurfaceIdentity, assertComponentSurface, buildAnalystSurfaceDispatch, buildEvidenceVector, buildLoopProvenanceRecord, campaignBreakdown, campaignMeanComposite, campaignMeasurementDigest, campaignScenarioIdentity, campaignSplitDigest, campaignSplitDigestFromIdentities, canonicalDigest, classifyUngroundedLiterals, codeSurfaceIdentityMaterial, compareOptimizationMethods, compareRankKeys, componentSurfaceIdentityMaterial, composeGate, costFromLedgerSummary, createReferenceEquivalenceJudge, createRunCostLedger, defaultProductionGate, detectScale, dimensionRegressions, discoverEvalFixtures, emitLoopProvenance, externalTextOptimizationMethod, failureModeRecallJudge, fsCampaignStorage, gepaOptimizationMethod, gitWorktreeAdapter, heldOutGate, heldoutSignificance, inMemoryCampaignStorage, isProposedCandidate, isTransientTransportFailure, labelTrustRank, llmJudge, loadEvalFixture, loadEvalFixtureScenarios, loopProvenanceArgsFromResult, loopProvenanceSpans, makePlaybackDispatch, neutralizationGate, neutralizeText, openAutoPr, openSearchLedger, optimizationTokenUsageFromSummary, pairHoldout, paretoPolicy, paretoSignificanceGate, planCampaignRun, planEvalFixtureRun, powerPreflight, provenanceRecordPath, provenanceSpansPath, renderScoreboardMarkdown, renderSurfaceDiff, resolveRunDir, resolveWorktreePath, rolloutArgumentDiff, runCampaign, runEval, runImprovementLoop, runOptimization, runProfileMatrix, scoreDiscrimination, scoreUserStory, scoreboardSummary, selectDiscriminative, sequentialDecide, sequentialPairedGate, skillOptOptimizationMethod, surfaceContentHash, surfaceHash, tangleTracesRoot, userStoryScoreboard, validateSearchLedgerEvent, verifyCodeSurface, verifyLoopProvenanceRecord };