@tangle-network/agent-eval 0.23.1 → 0.25.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 (148) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/README.md +212 -79
  3. package/dist/baseline-4R5deP0N.d.ts +108 -0
  4. package/dist/benchmarks/index.d.ts +3 -2
  5. package/dist/benchmarks/index.js +1 -1
  6. package/dist/builder-eval/index.d.ts +249 -0
  7. package/dist/builder-eval/index.js +391 -0
  8. package/dist/builder-eval/index.js.map +1 -0
  9. package/dist/{chunk-IOXMGMHQ.js → chunk-2A5XJB43.js} +142 -318
  10. package/dist/chunk-2A5XJB43.js.map +1 -0
  11. package/dist/chunk-47X6LRCE.js +76 -0
  12. package/dist/chunk-47X6LRCE.js.map +1 -0
  13. package/dist/{chunk-6M774GY6.js → chunk-4F5DQN55.js} +1 -1
  14. package/dist/chunk-4F5DQN55.js.map +1 -0
  15. package/dist/{chunk-KAO3Q65R.js → chunk-4S4BM3QQ.js} +15 -13
  16. package/dist/chunk-4S4BM3QQ.js.map +1 -0
  17. package/dist/chunk-5BKGXME7.js +65 -0
  18. package/dist/chunk-5BKGXME7.js.map +1 -0
  19. package/dist/{chunk-6KQG5HAH.js → chunk-5LBB5B3Z.js} +376 -72
  20. package/dist/chunk-5LBB5B3Z.js.map +1 -0
  21. package/dist/{chunk-42I2QC2L.js → chunk-6QDKWHLS.js} +18 -14
  22. package/dist/chunk-6QDKWHLS.js.map +1 -0
  23. package/dist/{chunk-VQQSPGSM.js → chunk-EDUKQ5AM.js} +247 -189
  24. package/dist/chunk-EDUKQ5AM.js.map +1 -0
  25. package/dist/chunk-I4MBDTY5.js +272 -0
  26. package/dist/chunk-I4MBDTY5.js.map +1 -0
  27. package/dist/chunk-JLZQWFV3.js +618 -0
  28. package/dist/chunk-JLZQWFV3.js.map +1 -0
  29. package/dist/chunk-K2TPS5LB.js +569 -0
  30. package/dist/chunk-K2TPS5LB.js.map +1 -0
  31. package/dist/chunk-KKHDIONI.js +414 -0
  32. package/dist/chunk-KKHDIONI.js.map +1 -0
  33. package/dist/chunk-KMPRBJK4.js +74 -0
  34. package/dist/chunk-KMPRBJK4.js.map +1 -0
  35. package/dist/{chunk-QUKKGHTZ.js → chunk-KTGTIOFD.js} +6 -3
  36. package/dist/chunk-KTGTIOFD.js.map +1 -0
  37. package/dist/chunk-LSH4MMOZ.js +838 -0
  38. package/dist/chunk-LSH4MMOZ.js.map +1 -0
  39. package/dist/chunk-NG236HPC.js +57 -0
  40. package/dist/chunk-NG236HPC.js.map +1 -0
  41. package/dist/{chunk-QBW3YBTR.js → chunk-NLMNWKVM.js} +14 -6
  42. package/dist/chunk-NLMNWKVM.js.map +1 -0
  43. package/dist/chunk-NU65VQ7M.js +99 -0
  44. package/dist/chunk-NU65VQ7M.js.map +1 -0
  45. package/dist/chunk-OWLAAMME.js +250 -0
  46. package/dist/chunk-OWLAAMME.js.map +1 -0
  47. package/dist/{chunk-SQQLHODJ.js → chunk-PC4UYEBM.js} +7 -4
  48. package/dist/chunk-PC4UYEBM.js.map +1 -0
  49. package/dist/{chunk-7EAUOUQS.js → chunk-RAF443UI.js} +213 -115
  50. package/dist/chunk-RAF443UI.js.map +1 -0
  51. package/dist/chunk-RZTMDUO7.js +49 -0
  52. package/dist/chunk-RZTMDUO7.js.map +1 -0
  53. package/dist/{chunk-EXGR4XEM.js → chunk-SESZDQPX.js} +23 -19
  54. package/dist/chunk-SESZDQPX.js.map +1 -0
  55. package/dist/{chunk-5IIQKMD5.js → chunk-TVVP3ZZQ.js} +14 -4
  56. package/dist/chunk-TVVP3ZZQ.js.map +1 -0
  57. package/dist/chunk-WWYCWKUM.js +196 -0
  58. package/dist/chunk-WWYCWKUM.js.map +1 -0
  59. package/dist/{chunk-AXHNWLIX.js → chunk-YRZ4M5GS.js} +2 -90
  60. package/dist/chunk-YRZ4M5GS.js.map +1 -0
  61. package/dist/chunk-ZN274SWR.js +613 -0
  62. package/dist/chunk-ZN274SWR.js.map +1 -0
  63. package/dist/cli.js +10 -6
  64. package/dist/cli.js.map +1 -1
  65. package/dist/{control-DvkH87qJ.d.ts → control-CBShYYA6.d.ts} +32 -33
  66. package/dist/control-runtime-BuJHoLg0.d.ts +180 -0
  67. package/dist/control.d.ts +8 -6
  68. package/dist/control.js +10 -7
  69. package/dist/{dataset-B9qvlm_o.d.ts → dataset-CiK_3LDr.d.ts} +5 -2
  70. package/dist/{emitter-B2XqDKFU.d.ts → emitter-DP_cSSiw.d.ts} +1 -1
  71. package/dist/errors-BZ9sTdz7.d.ts +70 -0
  72. package/dist/failure-cluster-C2EGSDiT.d.ts +76 -0
  73. package/dist/feedback-trajectory-DfFdrraJ.d.ts +169 -0
  74. package/dist/governance/index.d.ts +5 -0
  75. package/dist/governance/index.js +18 -0
  76. package/dist/governance/index.js.map +1 -0
  77. package/dist/{index-DDTlbHEK.d.ts → index--fVrWDiR.d.ts} +1 -1
  78. package/dist/index-Oj9fAPPN.d.ts +270 -0
  79. package/dist/index.d.ts +2018 -3003
  80. package/dist/index.js +7443 -9102
  81. package/dist/index.js.map +1 -1
  82. package/dist/{integrity-Cr5YodSY.d.ts → integrity-DK2EBVZC.d.ts} +4 -3
  83. package/dist/knowledge/index.d.ts +102 -0
  84. package/dist/knowledge/index.js +18 -0
  85. package/dist/knowledge/index.js.map +1 -0
  86. package/dist/meta-eval/index.d.ts +99 -0
  87. package/dist/meta-eval/index.js +324 -0
  88. package/dist/meta-eval/index.js.map +1 -0
  89. package/dist/multi-layer-verifier-LkP3LVKj.d.ts +141 -0
  90. package/dist/openapi.json +491 -1
  91. package/dist/optimization.d.ts +11 -8
  92. package/dist/optimization.js +11 -9
  93. package/dist/outcome-store-D6KWmYvj.d.ts +63 -0
  94. package/dist/pipelines/index.d.ts +172 -0
  95. package/dist/pipelines/index.js +345 -0
  96. package/dist/pipelines/index.js.map +1 -0
  97. package/dist/prm/index.d.ts +99 -0
  98. package/dist/prm/index.js +222 -0
  99. package/dist/prm/index.js.map +1 -0
  100. package/dist/query-DODUYdPg.d.ts +30 -0
  101. package/dist/release-report-BNgMdqPF.d.ts +292 -0
  102. package/dist/replay-BL96gCEP.d.ts +226 -0
  103. package/dist/reporting.d.ts +10 -295
  104. package/dist/reporting.js +10 -6
  105. package/dist/{eval-campaign-Ds5QljIh.d.ts → researcher-BPT8x_NT.d.ts} +148 -146
  106. package/dist/rl.d.ts +1762 -8
  107. package/dist/rl.js +2035 -58
  108. package/dist/rl.js.map +1 -1
  109. package/dist/rubric-D5tjHNJQ.d.ts +72 -0
  110. package/dist/rubric-predictive-validity-C0uDYwG6.d.ts +105 -0
  111. package/dist/{run-record-DNiOMBrZ.d.ts → run-record-CqzahIbx.d.ts} +4 -1
  112. package/dist/sequential-Dgz1n51-.d.ts +139 -0
  113. package/dist/{store-u47QaJ9G.d.ts → store-Db2Bv8Cf.d.ts} +1 -1
  114. package/dist/{summary-report-Ce1r4EYo.d.ts → summary-report-C7VPYEj2.d.ts} +3 -76
  115. package/dist/telemetry/file.js +4 -1
  116. package/dist/telemetry/file.js.map +1 -1
  117. package/dist/telemetry/index.js +57 -57
  118. package/dist/telemetry/index.js.map +1 -1
  119. package/dist/test-graded-scenario-B2kWEdh9.d.ts +146 -0
  120. package/dist/traces.d.ts +142 -387
  121. package/dist/traces.js +1302 -40
  122. package/dist/traces.js.map +1 -1
  123. package/dist/trajectory-CnoBo-JY.d.ts +32 -0
  124. package/dist/wire/index.d.ts +369 -25
  125. package/dist/wire/index.js +22 -3
  126. package/package.json +44 -18
  127. package/dist/chunk-42I2QC2L.js.map +0 -1
  128. package/dist/chunk-5IIQKMD5.js.map +0 -1
  129. package/dist/chunk-6KQG5HAH.js.map +0 -1
  130. package/dist/chunk-6M774GY6.js.map +0 -1
  131. package/dist/chunk-7EAUOUQS.js.map +0 -1
  132. package/dist/chunk-AXHNWLIX.js.map +0 -1
  133. package/dist/chunk-EXGR4XEM.js.map +0 -1
  134. package/dist/chunk-IOXMGMHQ.js.map +0 -1
  135. package/dist/chunk-KAO3Q65R.js.map +0 -1
  136. package/dist/chunk-LZKIOBG2.js +0 -2026
  137. package/dist/chunk-LZKIOBG2.js.map +0 -1
  138. package/dist/chunk-QBW3YBTR.js.map +0 -1
  139. package/dist/chunk-QUKKGHTZ.js.map +0 -1
  140. package/dist/chunk-SQQLHODJ.js.map +0 -1
  141. package/dist/chunk-V5QSWN7L.js +0 -1310
  142. package/dist/chunk-V5QSWN7L.js.map +0 -1
  143. package/dist/chunk-VQQSPGSM.js.map +0 -1
  144. package/dist/chunk-XPHOZPOM.js +0 -1947
  145. package/dist/chunk-XPHOZPOM.js.map +0 -1
  146. package/dist/feedback-trajectory-c43WGtTX.d.ts +0 -346
  147. package/dist/index-ekBXweiQ.d.ts +0 -1894
  148. package/dist/sequential-DgU2mFsE.d.ts +0 -304
@@ -1,295 +1,10 @@
1
- import { D as DatasetSplit, c as DatasetManifest, a as DatasetScenario } from './dataset-B9qvlm_o.js';
2
- import { C as GateDecision, A as ActionableSideInfo, m as MultiShotTrialResult } from './summary-report-Ce1r4EYo.js';
3
- export { Y as GainDistributionBin, Z as GainDistributionFigureSpec, _ as GainDistributionOptions, a3 as ParetoFigureSpec, a4 as ParetoPoint, a5 as RESEARCH_REPORT_HARD_PAIR_FLOOR, H as ResearchReport, a6 as ResearchReportCandidate, a7 as ResearchReportDecision, a8 as ResearchReportMethodology, F as ResearchReportOptions, a9 as ResearchReportRecommendation, aa as SummaryTable, ab as SummaryTableOptions, ac as SummaryTableRow, ah as gainHistogram, ai as paretoChart, al as researchReport, an as summaryTable } from './summary-report-Ce1r4EYo.js';
4
- import { R as RunRecord, a as RunSplitTag } from './run-record-DNiOMBrZ.js';
5
- export { c as InterimReleaseConfidence, d as InterimReleaseConfidenceInput, P as PairedEvalueOptions, e as PairedEvalueSequence, f as PairedEvalueStep, R as RubricOutcomePair, g as RubricPredictiveValidityInput, h as RubricPredictiveValidityReport, i as RubricRanking, S as SequentialDecision, j as evaluateInterimReleaseConfidence, p as pairedEvalueSequence, r as rubricPredictiveValidity } from './sequential-DgU2mFsE.js';
6
- import './store-u47QaJ9G.js';
7
-
8
- /**
9
- * Release confidence gate.
10
- *
11
- * This is the production-facing composition layer over the lower-level
12
- * primitives:
13
- * - Dataset manifests prove corpus/version coverage.
14
- * - RunRecord rows prove reproducible search/holdout outcomes.
15
- * - Multi-shot trace evidence carries turn counts and ASI diagnostics.
16
- * - HeldOutGate decisions remain the paired promotion authority.
17
- *
18
- * The gate is intentionally pure and conservative. Missing declared evidence
19
- * fails closed instead of being treated as a neutral zero.
20
- */
21
-
22
- type ReleaseConfidenceStatus = 'pass' | 'warn' | 'fail';
23
- type ReleaseConfidenceAxisName = 'corpus' | 'quality' | 'generalization' | 'diagnostics' | 'efficiency';
24
- interface ReleaseTraceEvidence {
25
- scenarioId: string;
26
- candidateId?: string;
27
- split?: RunSplitTag;
28
- score?: number;
29
- ok?: boolean;
30
- turnCount?: number;
31
- costUsd?: number;
32
- durationMs?: number;
33
- failureMode?: string;
34
- asi?: ActionableSideInfo[];
35
- metadata?: Record<string, unknown>;
36
- }
37
- interface ReleaseConfidenceThresholds {
38
- /** Require a Dataset manifest or explicit scenarios. Default true. */
39
- requireCorpus?: boolean;
40
- minScenarioCount?: number;
41
- minSearchRuns?: number;
42
- minHoldoutRuns?: number;
43
- /** Require at least one holdout scenario/run. Default true. */
44
- requireHoldout?: boolean;
45
- minPassRate?: number;
46
- minMeanScore?: number;
47
- /** Search mean may exceed holdout mean by at most this much. */
48
- maxOverfitGap?: number;
49
- maxMeanCostUsd?: number;
50
- maxP95WallMs?: number;
51
- /** Low-score/failed rows must carry ASI. Default true. */
52
- requireAsiForFailures?: boolean;
53
- /** Score below this is considered a failure for ASI coverage. Default 0.5. */
54
- failureScoreThreshold?: number;
55
- }
56
- interface ReleaseConfidenceInput {
57
- target: string;
58
- candidateId?: string;
59
- baselineId?: string;
60
- dataset?: DatasetManifest;
61
- scenarios?: readonly DatasetScenario[];
62
- runs?: readonly RunRecord[];
63
- traces?: readonly ReleaseTraceEvidence[];
64
- gateDecision?: GateDecision | null;
65
- thresholds?: ReleaseConfidenceThresholds;
66
- }
67
- interface ReleaseConfidenceAxis {
68
- name: ReleaseConfidenceAxisName;
69
- status: ReleaseConfidenceStatus;
70
- score: number;
71
- detail: string;
72
- }
73
- interface ReleaseConfidenceIssue {
74
- axis: ReleaseConfidenceAxisName;
75
- severity: 'critical' | 'warning';
76
- code: string;
77
- detail: string;
78
- }
79
- interface ReleaseConfidenceMetrics {
80
- scenarioCount: number;
81
- searchRuns: number;
82
- holdoutRuns: number;
83
- passRate: number;
84
- meanScore: number;
85
- searchMeanScore: number;
86
- holdoutMeanScore: number;
87
- overfitGap: number;
88
- meanCostUsd: number;
89
- p95WallMs: number;
90
- failedRows: number;
91
- failuresWithAsi: number;
92
- singleShotTraces: number;
93
- multiShotTraces: number;
94
- splitCounts: Record<DatasetSplit, number>;
95
- domainCounts: Record<string, number>;
96
- failureModeCounts: Record<string, number>;
97
- responsibleSurfaceCounts: Record<string, number>;
98
- }
99
- interface ReleaseConfidenceScorecard {
100
- target: string;
101
- candidateId: string | null;
102
- baselineId: string | null;
103
- status: ReleaseConfidenceStatus;
104
- promote: boolean;
105
- axes: ReleaseConfidenceAxis[];
106
- issues: ReleaseConfidenceIssue[];
107
- metrics: ReleaseConfidenceMetrics;
108
- dataset: DatasetManifest | null;
109
- gateDecision: GateDecision | null;
110
- summary: string;
111
- }
112
- declare function releaseTraceEvidenceFromMultiShotTrials(trials: readonly MultiShotTrialResult[]): ReleaseTraceEvidence[];
113
- declare function evaluateReleaseConfidence(input: ReleaseConfidenceInput): ReleaseConfidenceScorecard;
114
- declare function assertReleaseConfidence(input: ReleaseConfidenceInput): ReleaseConfidenceScorecard;
115
-
116
- /**
117
- * Paper-grade paired statistics for held-out promotion gates.
118
- *
119
- * The promotion gate (`HeldOutGate`) needs three things:
120
- *
121
- * 1. A bootstrap confidence interval on the per-item paired delta
122
- * (`pairedBootstrap`). Median delta is the headline number; the
123
- * CI lower bound is what the gate checks against `pairedDeltaThreshold`.
124
- * 2. A non-parametric significance test on the paired deltas
125
- * (`pairedWilcoxon` — re-export of `wilcoxonSignedRank` under the
126
- * paper-style name).
127
- * 3. False-discovery-rate correction across simultaneously-tested
128
- * candidate variants (`bhAdjust` — re-export of `benjaminiHochberg`).
129
- *
130
- * Why a separate file: every existing primitive lives in `statistics.ts`
131
- * (general) or `power-analysis.ts` (correction). Paired-bootstrap is
132
- * paired-only, paper-grade, and load-bearing for the promotion gate.
133
- * Putting it next to `statistics.ts` would require editing that file;
134
- * the brief forbids that. New file, new exports, no surface change.
135
- */
136
- interface PairedBootstrapResult {
137
- /** Number of paired observations (after dropping unequal lengths is rejected). */
138
- n: number;
139
- /** Median of paired deltas (after − before). */
140
- median: number;
141
- /** Mean of paired deltas. */
142
- mean: number;
143
- /** Lower bound of the bootstrap CI on the median delta. */
144
- low: number;
145
- /** Upper bound of the bootstrap CI on the median delta. */
146
- high: number;
147
- /** Confidence level used (e.g. 0.95). */
148
- confidence: number;
149
- /** Number of bootstrap resamples used. */
150
- resamples: number;
151
- }
152
- interface PairedBootstrapOptions {
153
- /** Confidence level. Default 0.95. */
154
- confidence?: number;
155
- /** Bootstrap resample count. Default 2000. */
156
- resamples?: number;
157
- /** Statistic to bootstrap. Default 'median'. */
158
- statistic?: 'median' | 'mean';
159
- /** Deterministic seed. If omitted, uses Math.random(). */
160
- seed?: number;
161
- }
162
- /**
163
- * Paired bootstrap on (after - before) deltas. Returns a CI on the
164
- * chosen statistic (median by default). Pairs are resampled with
165
- * replacement. The lower bound is what the promotion gate checks: if
166
- * `low > pairedDeltaThreshold`, the gain is real at the chosen
167
- * confidence level.
168
- *
169
- * Throws on unequal sample sizes — caller must align pairs upstream.
170
- */
171
- declare function pairedBootstrap(before: number[], after: number[], opts?: PairedBootstrapOptions): PairedBootstrapResult;
172
- /**
173
- * Paper-style alias for `wilcoxonSignedRank`. The signed-rank test on
174
- * paired deltas is the standard non-parametric significance test for
175
- * "candidate beats baseline on matched items." Use alongside the
176
- * bootstrap CI: bootstrap gives effect size, Wilcoxon gives p.
177
- */
178
- declare function pairedWilcoxon(before: number[], after: number[]): {
179
- w: number;
180
- p: number;
181
- };
182
- /**
183
- * Paper-style alias for `benjaminiHochberg`. Use to correct p-values
184
- * across multiple candidate-vs-baseline comparisons run in the same
185
- * promotion sweep. Returns BH-adjusted q-values and significance at
186
- * the requested FDR (default 0.05).
187
- */
188
- declare function bhAdjust(pValues: number[], fdr?: number): {
189
- qValues: number[];
190
- significant: boolean[];
191
- };
192
-
193
- interface RenderReleaseReportOptions {
194
- title?: string;
195
- runs?: readonly RunRecord[];
196
- comparator?: string;
197
- traceAnalystFindings?: readonly string[];
198
- nextActions?: readonly string[];
199
- }
200
- declare function renderReleaseReport(scorecard: ReleaseConfidenceScorecard, options?: RenderReleaseReportOptions): string;
201
-
202
- /**
203
- * Bootstrap-CI promotion gate.
204
- *
205
- * In any iterative-improvement loop (GEPA, prompt evolution, dataset
206
- * curation), the question is "did this generation actually improve, or are
207
- * we celebrating noise?". With small N and noisy outcomes, point-estimate
208
- * deltas lie. Bootstrap confidence intervals tell the operator whether the
209
- * delta is real before code or prompts get promoted.
210
- *
211
- * This module is pure functions — no I/O, no model calls. Easy to unit-test
212
- * and to compose into any verdict gate.
213
- *
214
- * Default gate:
215
- * - Bootstrap mean baseline vs candidate (1k resamples).
216
- * - Compute the delta distribution; pass if the lower CI bound > 0.
217
- * - Tunable confidence (default 95%) and resample count.
218
- *
219
- * Verdict semantics intentionally match the existing `experiments.jsonl`
220
- * vocabulary:
221
- * - ADVANCE: candidate's CI lower bound > baseline mean (real win)
222
- * - KEEP: overlap, but candidate point estimate >= baseline (neutral)
223
- * - REVERT: candidate's CI upper bound < baseline mean (real regression)
224
- * - INCONCLUSIVE: not enough samples or CI straddles zero with no signal
225
- */
226
- type Verdict = 'ADVANCE' | 'KEEP' | 'REVERT' | 'INCONCLUSIVE';
227
- interface BootstrapResult {
228
- baselineMean: number;
229
- candidateMean: number;
230
- /** candidateMean - baselineMean, point estimate. */
231
- delta: number;
232
- /** Lower bound of the (1 - alpha) CI on the delta. */
233
- ciLower: number;
234
- /** Upper bound of the (1 - alpha) CI on the delta. */
235
- ciUpper: number;
236
- /** Number of bootstrap resamples used. */
237
- iterations: number;
238
- alpha: number;
239
- verdict: Verdict;
240
- }
241
- interface BootstrapOptions {
242
- /** Confidence level alpha (default 0.05 → 95% CI). */
243
- alpha?: number;
244
- /** Number of resamples (default 1000). */
245
- iterations?: number;
246
- /**
247
- * Minimum total samples (baseline + candidate) below which we always
248
- * return INCONCLUSIVE — bootstrap with too few samples is meaningless.
249
- * Default 6 (combined).
250
- */
251
- minTotalSamples?: number;
252
- /** RNG seed for reproducibility. Default: Math.random. */
253
- seed?: number;
254
- }
255
- /**
256
- * Compute the bootstrap CI on (candidateMean - baselineMean) and a verdict.
257
- *
258
- * Uses simple percentile bootstrap on the difference of resampled means.
259
- * That's the standard non-parametric primitive — no distributional
260
- * assumptions, robust to skew, easy to reason about.
261
- */
262
- declare function bootstrapCi(baseline: number[], candidate: number[], options?: BootstrapOptions): BootstrapResult;
263
- /**
264
- * Judge-replay promotion gate.
265
- *
266
- * The cheap inner-loop judge that drives an evolution run is by definition
267
- * fast and noisy. When you're about to promote a winning variant to the
268
- * canonical default, you want a STRONGER judge (a more expensive model, a
269
- * human grader, a separately-trained reward model) to confirm the win
270
- * generalises beyond the inner loop.
271
- *
272
- * This helper takes raw winner + baseline outputs, scores both through the
273
- * stronger judge, and applies `bootstrapCi`. ADVANCE means the stronger
274
- * judge agrees the winner is real with the configured confidence. Doesn't
275
- * matter what shape your "output" is — pass a string, an object, anything
276
- * the judge can read.
277
- */
278
- interface JudgeReplayGateArgs<TOutput> {
279
- baselineOutputs: TOutput[];
280
- candidateOutputs: TOutput[];
281
- /** Stronger judge — async to allow LLM calls. Return a 0..N scalar score. */
282
- judge: (output: TOutput) => Promise<number> | number;
283
- alpha?: number;
284
- iterations?: number;
285
- /** RNG seed for reproducibility. */
286
- seed?: number;
287
- /** Maximum concurrent judge calls. Default 4. */
288
- judgeConcurrency?: number;
289
- }
290
- declare function judgeReplayGate<TOutput>(args: JudgeReplayGateArgs<TOutput>): Promise<BootstrapResult & {
291
- baselineSamples: number;
292
- candidateSamples: number;
293
- }>;
294
-
295
- export { type BootstrapOptions, type BootstrapResult, type JudgeReplayGateArgs, type PairedBootstrapOptions, type PairedBootstrapResult, type ReleaseConfidenceAxis, type ReleaseConfidenceAxisName, type ReleaseConfidenceInput, type ReleaseConfidenceIssue, type ReleaseConfidenceMetrics, type ReleaseConfidenceScorecard, type ReleaseConfidenceStatus, type ReleaseConfidenceThresholds, type ReleaseTraceEvidence, type RenderReleaseReportOptions, type Verdict, assertReleaseConfidence, bhAdjust, bootstrapCi, evaluateReleaseConfidence, judgeReplayGate, pairedBootstrap, pairedWilcoxon, releaseTraceEvidenceFromMultiShotTrials, renderReleaseReport };
1
+ export { R as RubricOutcomePair, a as RubricPredictiveValidityInput, b as RubricPredictiveValidityReport, c as RubricRanking, r as rubricPredictiveValidity } from './rubric-predictive-validity-C0uDYwG6.js';
2
+ export { B as BootstrapOptions, a as BootstrapResult, J as JudgeReplayGateArgs, P as PairedBootstrapOptions, b as PairedBootstrapResult, R as ReleaseConfidenceAxis, c as ReleaseConfidenceAxisName, d as ReleaseConfidenceInput, e as ReleaseConfidenceIssue, f as ReleaseConfidenceMetrics, g as ReleaseConfidenceScorecard, h as ReleaseConfidenceStatus, i as ReleaseConfidenceThresholds, j as ReleaseTraceEvidence, k as RenderReleaseReportOptions, V as Verdict, l as assertReleaseConfidence, m as bhAdjust, n as bootstrapCi, o as evaluateReleaseConfidence, p as judgeReplayGate, q as pairedBootstrap, r as pairedWilcoxon, s as releaseTraceEvidenceFromMultiShotTrials, t as renderReleaseReport } from './release-report-BNgMdqPF.js';
3
+ export { I as InterimReleaseConfidence, a as InterimReleaseConfidenceInput, P as PairedEvalueOptions, b as PairedEvalueSequence, c as PairedEvalueStep, S as SequentialDecision, e as evaluateInterimReleaseConfidence, p as pairedEvalueSequence } from './sequential-Dgz1n51-.js';
4
+ export { C as GainDistributionBin, F as GainDistributionFigureSpec, H as GainDistributionOptions, J as ParetoFigureSpec, K as ParetoPoint, L as RESEARCH_REPORT_HARD_PAIR_FLOOR, N as ResearchReport, O as ResearchReportCandidate, Q as ResearchReportDecision, U as ResearchReportMethodology, W as ResearchReportOptions, X as ResearchReportRecommendation, Y as SummaryTable, Z as SummaryTableOptions, _ as SummaryTableRow, $ as gainHistogram, a0 as paretoChart, a1 as researchReport, a2 as summaryTable } from './summary-report-C7VPYEj2.js';
5
+ import './run-record-CqzahIbx.js';
6
+ import './errors-BZ9sTdz7.js';
7
+ import './outcome-store-D6KWmYvj.js';
8
+ import './dataset-CiK_3LDr.js';
9
+ import './failure-cluster-C2EGSDiT.js';
10
+ import './store-Db2Bv8Cf.js';
package/dist/reporting.js CHANGED
@@ -5,12 +5,14 @@ import {
5
5
  judgeReplayGate,
6
6
  releaseTraceEvidenceFromMultiShotTrials,
7
7
  renderReleaseReport
8
- } from "./chunk-7EAUOUQS.js";
8
+ } from "./chunk-RAF443UI.js";
9
9
  import {
10
- evaluateInterimReleaseConfidence,
11
- pairedEvalueSequence,
12
10
  rubricPredictiveValidity
13
- } from "./chunk-AXHNWLIX.js";
11
+ } from "./chunk-YRZ4M5GS.js";
12
+ import {
13
+ evaluateInterimReleaseConfidence,
14
+ pairedEvalueSequence
15
+ } from "./chunk-NU65VQ7M.js";
14
16
  import {
15
17
  RESEARCH_REPORT_HARD_PAIR_FLOOR,
16
18
  bhAdjust,
@@ -20,8 +22,10 @@ import {
20
22
  paretoChart,
21
23
  researchReport,
22
24
  summaryTable
23
- } from "./chunk-IOXMGMHQ.js";
24
- import "./chunk-6M774GY6.js";
25
+ } from "./chunk-2A5XJB43.js";
26
+ import "./chunk-I4MBDTY5.js";
27
+ import "./chunk-4F5DQN55.js";
28
+ import "./chunk-NG236HPC.js";
25
29
  import "./chunk-PZ5AY32C.js";
26
30
  export {
27
31
  RESEARCH_REPORT_HARD_PAIR_FLOOR,
@@ -1,8 +1,9 @@
1
- import { C as GateDecision, F as ResearchReportOptions, H as ResearchReport } from './summary-report-Ce1r4EYo.js';
2
- import { R as RunRecord, a as RunSplitTag, b as RunTokenUsage, c as RunJudgeMetadata } from './run-record-DNiOMBrZ.js';
3
- import { R as RawProviderSink, P as ProviderRedactor, a as RunIntegrityExpectations, b as RunIntegrityReport } from './integrity-Cr5YodSY.js';
4
- import { T as TraceEmitter, R as RunCompleteHook } from './emitter-B2XqDKFU.js';
5
- import { T as TraceStore } from './store-u47QaJ9G.js';
1
+ import { A as AgentEvalError, C as CaptureIntegrityError } from './errors-BZ9sTdz7.js';
2
+ import { R as RawProviderSink, P as ProviderRedactor, a as RunIntegrityExpectations, b as RunIntegrityReport } from './integrity-DK2EBVZC.js';
3
+ import { a as RunSplitTag, b as RunTokenUsage, c as RunJudgeMetadata, R as RunRecord } from './run-record-CqzahIbx.js';
4
+ import { W as ResearchReportOptions, N as ResearchReport, a3 as GateDecision } from './summary-report-C7VPYEj2.js';
5
+ import { T as TraceEmitter, R as RunCompleteHook } from './emitter-DP_cSSiw.js';
6
+ import { T as TraceStore } from './store-Db2Bv8Cf.js';
6
7
 
7
8
  /**
8
9
  * LLM client with graceful degrade.
@@ -81,7 +82,7 @@ interface LlmCallResult {
81
82
  /** Raw response body. */
82
83
  raw: Record<string, unknown>;
83
84
  }
84
- declare class LlmCallError extends Error {
85
+ declare class LlmCallError extends AgentEvalError {
85
86
  readonly status: number;
86
87
  readonly body: string;
87
88
  readonly model: string;
@@ -147,10 +148,11 @@ declare function callLlmJson<T = unknown>(req: LlmCallRequest, opts?: LlmClientO
147
148
  value: T;
148
149
  result: LlmCallResult;
149
150
  }>;
150
- declare class LlmRouteAssertionError extends Error {
151
- readonly code: 'no_explicit_base_url' | 'base_url_blocked' | 'base_url_not_allowed' | 'no_auth' | 'wrong_provider';
151
+ type LlmRouteAssertionReason = 'no_explicit_base_url' | 'base_url_blocked' | 'base_url_not_allowed' | 'no_auth' | 'wrong_provider';
152
+ declare class LlmRouteAssertionError extends CaptureIntegrityError {
153
+ readonly reason: LlmRouteAssertionReason;
152
154
  readonly baseUrl: string;
153
- constructor(message: string, code: 'no_explicit_base_url' | 'base_url_blocked' | 'base_url_not_allowed' | 'no_auth' | 'wrong_provider', baseUrl: string);
155
+ constructor(message: string, reason: LlmRouteAssertionReason, baseUrl: string);
154
156
  }
155
157
  interface LlmRouteRequirements {
156
158
  /**
@@ -218,143 +220,6 @@ declare class LlmClient {
218
220
  }>;
219
221
  }
220
222
 
221
- /**
222
- * Researcher interface — stable hook for an external autonomous-research
223
- * agent to drive the meta-loop.
224
- *
225
- * Implementations live downstream (typically in a private repo that
226
- * runs the actual LLM). This package ships only the contract + a
227
- * `NoopResearcher` so consumers can wire the surface without being
228
- * forced to implement every method up front.
229
- *
230
- * The four methods mirror the four stages of the paper "Two Loops,
231
- * Three Roles":
232
- *
233
- * inspectFailures — given the observed runs, what failure modes
234
- * are present? (data → diagnosis)
235
- * proposeChange — given diagnosed failure modes, what
236
- * structural changes should we try?
237
- * (diagnosis → plan delta)
238
- * applyChange — fold the proposed deltas into a concrete
239
- * experiment plan against an existing baseline.
240
- * (plan delta → executable plan)
241
- * evaluateChange — run the plan, return runs + the gate verdict.
242
- * (executable plan → verdict)
243
- *
244
- * Composition is the discipline: a Researcher implementation MUST
245
- * keep these four steps separate and inspectable. Conflating
246
- * "diagnose + propose + run" into a single LLM call defeats the
247
- * point of the framework — you can't audit which step lied.
248
- *
249
- * THIS INTERFACE IS STABLE. Breaking changes require a new module
250
- * (e.g. `Researcher2`) so existing implementations keep working.
251
- */
252
-
253
- /** A diagnosed failure mode with the run-IDs that exhibit it. */
254
- interface FailureMode {
255
- /** Short machine-readable code. Must be stable across runs of the
256
- * same researcher to enable longitudinal tracking. */
257
- code: string;
258
- /** Human-readable description for the paper / dashboard. */
259
- description: string;
260
- evidence: {
261
- /** Run IDs (from `RunRecord.runId`) where this failure mode was
262
- * observed. */
263
- runIds: string[];
264
- /** Number of run samples that informed the diagnosis. */
265
- samples: number;
266
- };
267
- }
268
- /** A single steering change the researcher wants to try. */
269
- interface SteeringChange {
270
- kind: 'reviewer_prompt' | 'skill_add' | 'skill_remove' | 'threshold' | 'budget';
271
- /** Implementation-specific payload. Researcher implementations
272
- * define the schema — keep this `unknown` here to avoid coupling
273
- * the public interface to any one researcher's internal model. */
274
- payload: unknown;
275
- /** Why the researcher proposed this change. Goes into the audit
276
- * trail next to the failure-mode evidence. */
277
- rationale: string;
278
- /** Optional self-reported expected delta on the headline metric. */
279
- expectedDelta?: number;
280
- }
281
- /** A single experiment plan, mapped onto the search/holdout splits. */
282
- interface ExperimentPlan {
283
- baselineCandidateId: string;
284
- proposedCandidateId: string;
285
- changes: SteeringChange[];
286
- /** USD ceiling for the entire experiment. The runner must stop
287
- * before exceeding this and report a partial result. */
288
- evaluationBudgetUsd: number;
289
- /** Item IDs (your dataset keys) for the search vs holdout splits. */
290
- splits: {
291
- search: string[];
292
- holdout: string[];
293
- };
294
- }
295
- /** Result of running a plan: every run, plus the gate verdict. */
296
- interface ExperimentResult {
297
- plan: ExperimentPlan;
298
- runs: RunRecord[];
299
- gateDecision: GateDecision;
300
- }
301
- /**
302
- * The researcher loop. Stable, four-step, inspectable.
303
- *
304
- * ┌──────────┐ inspectFailures ┌──────────┐ proposeChange ┌──────────┐
305
- * │ runs │ ─────────────────▶│ failures │ ──────────────▶│ changes │
306
- * └──────────┘ └──────────┘ └────┬─────┘
307
- * │
308
- * ▼
309
- * ┌────────────────┐ applyChange ┌────────┐
310
- * │ ExperimentPlan │ ◀────────────│ base │
311
- * └────────┬───────┘ └────────┘
312
- * │
313
- * evaluateChange ▼
314
- * ┌────────────────┐
315
- * │ ExperimentResult│
316
- * └────────────────┘
317
- */
318
- interface Researcher {
319
- inspectFailures(runs: RunRecord[]): Promise<FailureMode[]>;
320
- proposeChange(failures: FailureMode[]): Promise<SteeringChange[]>;
321
- applyChange(changes: SteeringChange[], baseline: ExperimentPlan): Promise<ExperimentPlan>;
322
- evaluateChange(plan: ExperimentPlan): Promise<ExperimentResult>;
323
- }
324
- interface CallbackResearcherOptions {
325
- inspectFailures: Researcher['inspectFailures'];
326
- proposeChange: Researcher['proposeChange'];
327
- applyChange: Researcher['applyChange'];
328
- evaluateChange: Researcher['evaluateChange'];
329
- }
330
- /**
331
- * Minimal concrete researcher for tests, scripts, and small integrations.
332
- * Larger autonomous researchers can still implement `Researcher` directly.
333
- */
334
- declare class CallbackResearcher implements Researcher {
335
- private readonly callbacks;
336
- constructor(callbacks: CallbackResearcherOptions);
337
- inspectFailures(runs: RunRecord[]): Promise<FailureMode[]>;
338
- proposeChange(failures: FailureMode[]): Promise<SteeringChange[]>;
339
- applyChange(changes: SteeringChange[], baseline: ExperimentPlan): Promise<ExperimentPlan>;
340
- evaluateChange(plan: ExperimentPlan): Promise<ExperimentResult>;
341
- }
342
- /**
343
- * No-op researcher — fails loud on every method. Use as a placeholder
344
- * in code paths that wire the interface but don't have an implementation
345
- * yet. Importantly, this does NOT silently succeed: a no-op researcher
346
- * that returned empty arrays would muffle the loop's signal that
347
- * nobody implemented the brain.
348
- */
349
- declare class NoopResearcher implements Researcher {
350
- private readonly hint;
351
- constructor(hint?: string);
352
- inspectFailures(_runs: RunRecord[]): Promise<FailureMode[]>;
353
- proposeChange(_failures: FailureMode[]): Promise<SteeringChange[]>;
354
- applyChange(_changes: SteeringChange[], _baseline: ExperimentPlan): Promise<ExperimentPlan>;
355
- evaluateChange(_plan: ExperimentPlan): Promise<ExperimentResult>;
356
- }
357
-
358
223
  /**
359
224
  * EvalCampaign — opinionated matrix runner that wires the four
360
225
  * capture-integrity directives by construction.
@@ -570,4 +435,141 @@ interface EvalCampaignResult {
570
435
  }
571
436
  declare function runEvalCampaign<V>(opts: EvalCampaignOptions<V>): Promise<EvalCampaignResult>;
572
437
 
438
+ /**
439
+ * Researcher interface — stable hook for an external autonomous-research
440
+ * agent to drive the meta-loop.
441
+ *
442
+ * Implementations live downstream (typically in a private repo that
443
+ * runs the actual LLM). This package ships only the contract + a
444
+ * `NoopResearcher` so consumers can wire the surface without being
445
+ * forced to implement every method up front.
446
+ *
447
+ * The four methods mirror the four stages of the paper "Two Loops,
448
+ * Three Roles":
449
+ *
450
+ * inspectFailures — given the observed runs, what failure modes
451
+ * are present? (data → diagnosis)
452
+ * proposeChange — given diagnosed failure modes, what
453
+ * structural changes should we try?
454
+ * (diagnosis → plan delta)
455
+ * applyChange — fold the proposed deltas into a concrete
456
+ * experiment plan against an existing baseline.
457
+ * (plan delta → executable plan)
458
+ * evaluateChange — run the plan, return runs + the gate verdict.
459
+ * (executable plan → verdict)
460
+ *
461
+ * Composition is the discipline: a Researcher implementation MUST
462
+ * keep these four steps separate and inspectable. Conflating
463
+ * "diagnose + propose + run" into a single LLM call defeats the
464
+ * point of the framework — you can't audit which step lied.
465
+ *
466
+ * THIS INTERFACE IS STABLE. Breaking changes require a new module
467
+ * (e.g. `Researcher2`) so existing implementations keep working.
468
+ */
469
+
470
+ /** A diagnosed failure mode with the run-IDs that exhibit it. */
471
+ interface FailureMode {
472
+ /** Short machine-readable code. Must be stable across runs of the
473
+ * same researcher to enable longitudinal tracking. */
474
+ code: string;
475
+ /** Human-readable description for the paper / dashboard. */
476
+ description: string;
477
+ evidence: {
478
+ /** Run IDs (from `RunRecord.runId`) where this failure mode was
479
+ * observed. */
480
+ runIds: string[];
481
+ /** Number of run samples that informed the diagnosis. */
482
+ samples: number;
483
+ };
484
+ }
485
+ /** A single steering change the researcher wants to try. */
486
+ interface SteeringChange {
487
+ kind: 'reviewer_prompt' | 'skill_add' | 'skill_remove' | 'threshold' | 'budget';
488
+ /** Implementation-specific payload. Researcher implementations
489
+ * define the schema — keep this `unknown` here to avoid coupling
490
+ * the public interface to any one researcher's internal model. */
491
+ payload: unknown;
492
+ /** Why the researcher proposed this change. Goes into the audit
493
+ * trail next to the failure-mode evidence. */
494
+ rationale: string;
495
+ /** Optional self-reported expected delta on the headline metric. */
496
+ expectedDelta?: number;
497
+ }
498
+ /** A single experiment plan, mapped onto the search/holdout splits. */
499
+ interface ExperimentPlan {
500
+ baselineCandidateId: string;
501
+ proposedCandidateId: string;
502
+ changes: SteeringChange[];
503
+ /** USD ceiling for the entire experiment. The runner must stop
504
+ * before exceeding this and report a partial result. */
505
+ evaluationBudgetUsd: number;
506
+ /** Item IDs (your dataset keys) for the search vs holdout splits. */
507
+ splits: {
508
+ search: string[];
509
+ holdout: string[];
510
+ };
511
+ }
512
+ /** Result of running a plan: every run, plus the gate verdict. */
513
+ interface ExperimentResult {
514
+ plan: ExperimentPlan;
515
+ runs: RunRecord[];
516
+ gateDecision: GateDecision;
517
+ }
518
+ /**
519
+ * The researcher loop. Stable, four-step, inspectable.
520
+ *
521
+ * ┌──────────┐ inspectFailures ┌──────────┐ proposeChange ┌──────────┐
522
+ * │ runs │ ─────────────────▶│ failures │ ──────────────▶│ changes │
523
+ * └──────────┘ └──────────┘ └────┬─────┘
524
+ * │
525
+ * ▼
526
+ * ┌────────────────┐ applyChange ┌────────┐
527
+ * │ ExperimentPlan │ ◀────────────│ base │
528
+ * └────────┬───────┘ └────────┘
529
+ * │
530
+ * evaluateChange ▼
531
+ * ┌────────────────┐
532
+ * │ ExperimentResult│
533
+ * └────────────────┘
534
+ */
535
+ interface Researcher {
536
+ inspectFailures(runs: RunRecord[]): Promise<FailureMode[]>;
537
+ proposeChange(failures: FailureMode[]): Promise<SteeringChange[]>;
538
+ applyChange(changes: SteeringChange[], baseline: ExperimentPlan): Promise<ExperimentPlan>;
539
+ evaluateChange(plan: ExperimentPlan): Promise<ExperimentResult>;
540
+ }
541
+ interface CallbackResearcherOptions {
542
+ inspectFailures: Researcher['inspectFailures'];
543
+ proposeChange: Researcher['proposeChange'];
544
+ applyChange: Researcher['applyChange'];
545
+ evaluateChange: Researcher['evaluateChange'];
546
+ }
547
+ /**
548
+ * Minimal concrete researcher for tests, scripts, and small integrations.
549
+ * Larger autonomous researchers can still implement `Researcher` directly.
550
+ */
551
+ declare class CallbackResearcher implements Researcher {
552
+ private readonly callbacks;
553
+ constructor(callbacks: CallbackResearcherOptions);
554
+ inspectFailures(runs: RunRecord[]): Promise<FailureMode[]>;
555
+ proposeChange(failures: FailureMode[]): Promise<SteeringChange[]>;
556
+ applyChange(changes: SteeringChange[], baseline: ExperimentPlan): Promise<ExperimentPlan>;
557
+ evaluateChange(plan: ExperimentPlan): Promise<ExperimentResult>;
558
+ }
559
+ /**
560
+ * No-op researcher — fails loud on every method. Use as a placeholder
561
+ * in code paths that wire the interface but don't have an implementation
562
+ * yet. Importantly, this does NOT silently succeed: a no-op researcher
563
+ * that returned empty arrays would muffle the loop's signal that
564
+ * nobody implemented the brain.
565
+ */
566
+ declare class NoopResearcher implements Researcher {
567
+ private readonly hint;
568
+ constructor(hint?: string);
569
+ inspectFailures(_runs: RunRecord[]): Promise<FailureMode[]>;
570
+ proposeChange(_failures: FailureMode[]): Promise<SteeringChange[]>;
571
+ applyChange(_changes: SteeringChange[], _baseline: ExperimentPlan): Promise<ExperimentPlan>;
572
+ evaluateChange(_plan: ExperimentPlan): Promise<ExperimentResult>;
573
+ }
574
+
573
575
  export { CallbackResearcher as C, type EvalCampaignOptions as E, type FailedRun as F, type LlmClientOptions as L, NoopResearcher as N, type Researcher as R, type SteeringChange as S, type CallbackResearcherOptions as a, type CampaignFactoryParams as b, type CampaignIntegrityPolicy as c, type CampaignRunContext as d, type CampaignRunOutcome as e, type CampaignRunner as f, type CampaignScenario as g, type CampaignVariant as h, type EvalCampaignResult as i, type ExperimentPlan as j, type ExperimentResult as k, type FailureMode as l, LlmCallError as m, type LlmCallRequest as n, type LlmCallResult as o, LlmClient as p, type LlmMessage as q, runEvalCampaign as r, LlmRouteAssertionError as s, type LlmRouteRequirements as t, type LlmUsage as u, assertLlmRoute as v, callLlm as w, callLlmJson as x, probeLlm as y, stripFencedJson as z };