@tangle-network/agent-eval 0.17.3 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1151,199 +1151,6 @@ declare class Dataset {
1151
1151
  }
1152
1152
  declare function hashScenarios(scenarios: DatasetScenario[]): Promise<string>;
1153
1153
 
1154
- /**
1155
- * Prompt optimizer — A/B test prompt variants with statistical rigor.
1156
- *
1157
- * Runs N prompt variants against a fixed scenario set, collects per-scenario
1158
- * scores via the user-provided `scoreVariant` callback, and returns:
1159
- * - per-variant mean + bootstrap CI
1160
- * - pairwise significance (Mann-Whitney, non-parametric — works on any
1161
- * score distribution, not just normal)
1162
- * - a winner (highest mean, flagged if the lead is not significant)
1163
- *
1164
- * Deliberately generic — the `scoreVariant` callback does whatever domain
1165
- * work the consumer needs (invoke the agent, judge the output, whatever),
1166
- * and returns a number per scenario. This lets the optimizer stay small +
1167
- * testable.
1168
- */
1169
- interface PromptVariant$1 {
1170
- id: string;
1171
- prompt: string;
1172
- metadata?: Record<string, unknown>;
1173
- }
1174
- interface OptimizationConfig {
1175
- variants: PromptVariant$1[];
1176
- /** How many trials per (variant, scenario) — controls CI tightness. Default 3. */
1177
- trialsPerScenario?: number;
1178
- /** Significance threshold for pairwise comparison (default 0.05). */
1179
- significanceLevel?: number;
1180
- /**
1181
- * The scoring callback. For each (variant, scenarioId, trialIndex), produce
1182
- * a score in 0..1 (or any numeric range — the optimizer only cares about
1183
- * monotonicity).
1184
- */
1185
- scoreVariant: (args: {
1186
- variant: PromptVariant$1;
1187
- scenarioId: string;
1188
- trialIndex: number;
1189
- }) => Promise<number>;
1190
- /** Scenario ids to run against. */
1191
- scenarioIds: string[];
1192
- /** Optional hook — fires after each (variant, scenario) fully scored. */
1193
- onScenarioComplete?: (info: {
1194
- variantId: string;
1195
- scenarioId: string;
1196
- scores: number[];
1197
- }) => void;
1198
- }
1199
- interface VariantScore {
1200
- variantId: string;
1201
- mean: number;
1202
- ci95: {
1203
- lower: number;
1204
- upper: number;
1205
- };
1206
- n: number;
1207
- perScenario: Record<string, {
1208
- mean: number;
1209
- n: number;
1210
- samples: number[];
1211
- }>;
1212
- }
1213
- interface PairwiseComparison {
1214
- variantA: string;
1215
- variantB: string;
1216
- pValue: number;
1217
- /** BH-FDR-corrected q-value across all n*(n-1)/2 pairwise tests. */
1218
- qValue: number;
1219
- /** True when q-value passes the FDR threshold. Prefer over raw p-value when variants > 2. */
1220
- significant: boolean;
1221
- meanDelta: number;
1222
- }
1223
- interface OptimizationResult {
1224
- winner: {
1225
- variantId: string;
1226
- /** True when the winner's lead vs every other variant is statistically significant. */
1227
- significant: boolean;
1228
- ciLowerBoundExceedsSecondMean: boolean;
1229
- };
1230
- scores: VariantScore[];
1231
- pairwise: PairwiseComparison[];
1232
- config: {
1233
- trialsPerScenario: number;
1234
- significanceLevel: number;
1235
- variants: string[];
1236
- scenarios: string[];
1237
- };
1238
- }
1239
- declare class PromptOptimizer {
1240
- run(config: OptimizationConfig): Promise<OptimizationResult>;
1241
- }
1242
-
1243
- interface RunScore {
1244
- success: number;
1245
- goalProgress: number;
1246
- repoGroundedness: number;
1247
- driftPenalty: number;
1248
- toolUseQuality: number;
1249
- patchQuality: number;
1250
- testReality: number;
1251
- finalGate: number;
1252
- reviewerBlockers: number;
1253
- costUsd: number;
1254
- wallSeconds: number;
1255
- notes?: string[];
1256
- }
1257
- interface RunScoreWeights {
1258
- success: number;
1259
- goalProgress: number;
1260
- repoGroundedness: number;
1261
- driftPenalty: number;
1262
- toolUseQuality: number;
1263
- patchQuality: number;
1264
- testReality: number;
1265
- finalGate: number;
1266
- reviewerBlockers: number;
1267
- costUsd: number;
1268
- wallSeconds: number;
1269
- }
1270
- declare const DEFAULT_RUN_SCORE_WEIGHTS: RunScoreWeights;
1271
- declare function aggregateRunScore(score: RunScore, weights?: Partial<RunScoreWeights>): number;
1272
- declare function clamp01(value: number): number;
1273
-
1274
- interface SteeringRolePrompt {
1275
- system?: string;
1276
- append?: string;
1277
- }
1278
- interface SteeringBundle {
1279
- id: string;
1280
- coderPrompt?: string;
1281
- continuePrompt?: string;
1282
- reviewerPrompts?: Record<string, string>;
1283
- skills?: string[];
1284
- rolePrompts?: Record<string, SteeringRolePrompt>;
1285
- metadata?: Record<string, unknown>;
1286
- }
1287
- interface SteeringDelta {
1288
- coderPrompt?: string;
1289
- continuePrompt?: string;
1290
- reviewerPrompts?: Record<string, string>;
1291
- skills?: string[];
1292
- rolePrompts?: Record<string, SteeringRolePrompt>;
1293
- metadata?: Record<string, unknown>;
1294
- }
1295
- declare function mergeSteeringBundle(base: SteeringBundle, delta: SteeringDelta): SteeringBundle;
1296
- declare function renderSteeringText(bundle: SteeringBundle): string;
1297
-
1298
- interface OptimizationExample {
1299
- scenarioId: string;
1300
- metadata?: Record<string, unknown>;
1301
- }
1302
- interface SteeringEvaluation {
1303
- variant: SteeringBundle;
1304
- example: OptimizationExample;
1305
- trialIndex: number;
1306
- }
1307
- interface SteeringVariantReport {
1308
- variantId: string;
1309
- bundle: SteeringBundle;
1310
- mean: number;
1311
- ci95: {
1312
- lower: number;
1313
- upper: number;
1314
- };
1315
- scenarioScores: Record<string, {
1316
- mean: number;
1317
- n: number;
1318
- samples: number[];
1319
- }>;
1320
- }
1321
- interface OptimizationLoopResult {
1322
- winner: SteeringBundle;
1323
- significant: boolean;
1324
- reports: SteeringVariantReport[];
1325
- pairwise: Array<{
1326
- variantA: string;
1327
- variantB: string;
1328
- pValue: number;
1329
- qValue: number;
1330
- significant: boolean;
1331
- meanDelta: number;
1332
- }>;
1333
- }
1334
- interface OptimizationLoopConfig {
1335
- variants: SteeringBundle[];
1336
- examples: OptimizationExample[];
1337
- evaluate: (args: SteeringEvaluation) => Promise<RunScore>;
1338
- scoreWeights?: Partial<RunScoreWeights>;
1339
- trialsPerScenario?: number;
1340
- }
1341
- declare class OptimizationLoop {
1342
- private readonly optimizer;
1343
- constructor(optimizer?: PromptOptimizer);
1344
- run(config: OptimizationLoopConfig): Promise<OptimizationLoopResult>;
1345
- }
1346
-
1347
1154
  type FeedbackArtifactType = 'text' | 'code' | 'plan' | 'research' | 'action' | 'ui' | 'decision' | 'data' | 'other';
1348
1155
  type FeedbackLabelSource = 'user' | 'judge' | 'environment' | 'metric' | 'policy' | 'system';
1349
1156
  type FeedbackLabelKind = 'approve' | 'reject' | 'select' | 'edit' | 'rank' | 'rate' | 'comment' | 'metric_outcome' | 'policy_block' | 'revision_request';
@@ -1432,10 +1239,12 @@ interface PreferenceMemoryEntry {
1432
1239
  sourceLabelId?: string;
1433
1240
  category?: string;
1434
1241
  }
1435
- interface FeedbackOptimizerRow extends OptimizationExample {
1242
+ interface FeedbackOptimizerRow {
1243
+ scenarioId: string;
1436
1244
  trajectoryId: string;
1437
1245
  labelKinds: FeedbackLabelKind[];
1438
1246
  score?: number;
1247
+ metadata?: Record<string, unknown>;
1439
1248
  }
1440
1249
  interface FeedbackReplayResult {
1441
1250
  trajectoryId: string;
@@ -2070,6 +1879,61 @@ declare class D1ExperimentStore implements ExperimentStore {
2070
1879
  listRuns(experimentId: string): Promise<Run[]>;
2071
1880
  }
2072
1881
 
1882
+ interface SteeringRolePrompt {
1883
+ system?: string;
1884
+ append?: string;
1885
+ }
1886
+ interface SteeringBundle {
1887
+ id: string;
1888
+ coderPrompt?: string;
1889
+ continuePrompt?: string;
1890
+ reviewerPrompts?: Record<string, string>;
1891
+ skills?: string[];
1892
+ rolePrompts?: Record<string, SteeringRolePrompt>;
1893
+ metadata?: Record<string, unknown>;
1894
+ }
1895
+ interface SteeringDelta {
1896
+ coderPrompt?: string;
1897
+ continuePrompt?: string;
1898
+ reviewerPrompts?: Record<string, string>;
1899
+ skills?: string[];
1900
+ rolePrompts?: Record<string, SteeringRolePrompt>;
1901
+ metadata?: Record<string, unknown>;
1902
+ }
1903
+ declare function mergeSteeringBundle(base: SteeringBundle, delta: SteeringDelta): SteeringBundle;
1904
+ declare function renderSteeringText(bundle: SteeringBundle): string;
1905
+
1906
+ interface RunScore {
1907
+ success: number;
1908
+ goalProgress: number;
1909
+ repoGroundedness: number;
1910
+ driftPenalty: number;
1911
+ toolUseQuality: number;
1912
+ patchQuality: number;
1913
+ testReality: number;
1914
+ finalGate: number;
1915
+ reviewerBlockers: number;
1916
+ costUsd: number;
1917
+ wallSeconds: number;
1918
+ notes?: string[];
1919
+ }
1920
+ interface RunScoreWeights {
1921
+ success: number;
1922
+ goalProgress: number;
1923
+ repoGroundedness: number;
1924
+ driftPenalty: number;
1925
+ toolUseQuality: number;
1926
+ patchQuality: number;
1927
+ testReality: number;
1928
+ finalGate: number;
1929
+ reviewerBlockers: number;
1930
+ costUsd: number;
1931
+ wallSeconds: number;
1932
+ }
1933
+ declare const DEFAULT_RUN_SCORE_WEIGHTS: RunScoreWeights;
1934
+ declare function aggregateRunScore(score: RunScore, weights?: Partial<RunScoreWeights>): number;
1935
+ declare function clamp01(value: number): number;
1936
+
2073
1937
  /**
2074
1938
  * Typed query helpers over TraceStore.
2075
1939
  *
@@ -3809,9 +3673,9 @@ declare function toolNamesForRun(store: TraceStore, runId: string): Promise<stri
3809
3673
  * returns the N per arm needed to detect a given effect size.
3810
3674
  * 2. After running: `benjaminiHochberg(pValues, fdr)` and
3811
3675
  * `bonferroni(pValues, alpha)` correct for multiple pairwise tests
3812
- * so PromptOptimizer's "significant" flag is statistically honest.
3676
+ * so pairwise variant comparisons stay statistically honest.
3813
3677
  *
3814
- * Fixes the correctness bug in 0.2's PromptOptimizer which applied
3678
+ * Fixes the correctness bug in 0.2's pairwise optimizer which applied
3815
3679
  * alpha directly across n*(n-1)/2 pairwise tests without correction —
3816
3680
  * dramatically inflating false-positive rate when variants ≥ 3.
3817
3681
  */
@@ -7505,7 +7369,7 @@ declare function referenceReplayScenarioToRunScore(scenarioScore: ReferenceRepla
7505
7369
  * 4. Repeat for N generations OR until convergence.
7506
7370
  *
7507
7371
  * Domain-agnostic. Consumers supply:
7508
- * - A seed population of `PromptVariant`s.
7372
+ * - A seed population of `EvolvableVariant`s.
7509
7373
  * - A `ScoreAdapter` that runs (variant, scenario, rep) → `TrialResult`.
7510
7374
  * - A `MutateAdapter` that produces children given trace evidence.
7511
7375
  * - Pareto `Objective<TrialAggregate>[]` defining the multi-objective vector.
@@ -7517,7 +7381,7 @@ declare function referenceReplayScenarioToRunScore(scenarioScore: ReferenceRepla
7517
7381
  * mutation primitives, persisting to disk. Those are the consumer's call.
7518
7382
  */
7519
7383
 
7520
- interface PromptVariant<P = unknown> {
7384
+ interface EvolvableVariant<P = unknown> {
7521
7385
  /** Stable id for the variant — surfaces in reports and trial results. */
7522
7386
  id: string;
7523
7387
  /** Variant payload — interpretation is the consumer's responsibility. */
@@ -7571,26 +7435,26 @@ interface VariantAggregate {
7571
7435
  }
7572
7436
  interface ScoreAdapter<P = unknown> {
7573
7437
  score(args: {
7574
- variant: PromptVariant<P>;
7438
+ variant: EvolvableVariant<P>;
7575
7439
  scenarioId: string;
7576
7440
  rep: number;
7577
7441
  }): Promise<TrialResult>;
7578
7442
  }
7579
7443
  interface MutateAdapter<P = unknown> {
7580
7444
  mutate(args: {
7581
- parent: PromptVariant<P>;
7445
+ parent: EvolvableVariant<P>;
7582
7446
  parentAggregate: VariantAggregate;
7583
7447
  topTrials: TrialResult[];
7584
7448
  bottomTrials: TrialResult[];
7585
7449
  childCount: number;
7586
7450
  generation: number;
7587
- }): Promise<PromptVariant<P>[]>;
7451
+ }): Promise<EvolvableVariant<P>[]>;
7588
7452
  }
7589
7453
  interface PromptEvolutionConfig<P = unknown> {
7590
7454
  runId: string;
7591
7455
  /** What component is being mutated — surfaces in reports + reflection prompts. */
7592
7456
  target: string;
7593
- seedVariants: PromptVariant<P>[];
7457
+ seedVariants: EvolvableVariant<P>[];
7594
7458
  scenarioIds: string[];
7595
7459
  reps: number;
7596
7460
  generations: number;
@@ -7649,7 +7513,7 @@ interface GenerationReport<P = unknown> {
7649
7513
  runId: string;
7650
7514
  target: string;
7651
7515
  generation: number;
7652
- variants: PromptVariant<P>[];
7516
+ variants: EvolvableVariant<P>[];
7653
7517
  aggregates: VariantAggregate[];
7654
7518
  /** Frontier candidates, sorted by descending crowding distance. */
7655
7519
  paretoFrontIds: string[];
@@ -7663,12 +7527,239 @@ interface PromptEvolutionResult<P = unknown> {
7663
7527
  target: string;
7664
7528
  generations: GenerationReport<P>[];
7665
7529
  /** Best variant by scalar score in the final generation. */
7666
- bestVariant: PromptVariant<P>;
7530
+ bestVariant: EvolvableVariant<P>;
7667
7531
  /** Best aggregate (matches bestVariant). */
7668
7532
  bestAggregate: VariantAggregate;
7669
7533
  }
7670
7534
  declare function runPromptEvolution<P>(config: PromptEvolutionConfig<P>): Promise<PromptEvolutionResult<P>>;
7671
7535
 
7536
+ /**
7537
+ * Reflective mutation — primitives for trace-conditioned prompt rewriting.
7538
+ *
7539
+ * Used by `prompt-evolution.ts` (and any consumer running iterative
7540
+ * improvement). Given a parent prompt + concrete trace evidence (top trials,
7541
+ * bottom trials, missed expectations), produce an LLM-ready prompt that
7542
+ * proposes targeted mutations — not blind rephrasings.
7543
+ *
7544
+ * Why this lives outside `prompt-evolution.ts`: any consumer that wants to
7545
+ * run reflective rewriting WITHOUT the population/Pareto machinery can
7546
+ * import these primitives directly.
7547
+ *
7548
+ * Quality bar (vs. naive "mutate this prompt"):
7549
+ * - Show parent ↔ children diff, not just one variant
7550
+ * - Quote specific missed goldens with their match phrases
7551
+ * - Surface the model's actual emitted output side-by-side with what was expected
7552
+ * - Quote concrete mutation primitives so the model has a vocabulary
7553
+ */
7554
+ interface TrialTrace {
7555
+ /** Stable id for the trial — surfaces in the prompt for grounding. */
7556
+ id: string;
7557
+ /** Score the trial received on its primary metric. */
7558
+ score: number;
7559
+ /** Candidate inputs the agent was given (e.g., the fixture or scenario). */
7560
+ inputName?: string;
7561
+ /**
7562
+ * Goldens / expectations this trial was tested against, with whether each
7563
+ * was matched. The reflection prompt quotes the missed ones specifically.
7564
+ */
7565
+ expectations?: Array<{
7566
+ id: string;
7567
+ phrase: string;
7568
+ matched: boolean;
7569
+ }>;
7570
+ /** Free-form text — what the agent actually emitted (e.g., findings, plan). */
7571
+ emitted?: string;
7572
+ /** Optional structured metrics (recall, precision, cost, latency). */
7573
+ metrics?: Record<string, number>;
7574
+ }
7575
+ interface ReflectionContext {
7576
+ /** What is being mutated — appears in the system prompt for orientation. */
7577
+ target: string;
7578
+ /** Current variant's payload — JSON-serialised for the prompt. */
7579
+ parentPayload: unknown;
7580
+ /** Best-performing trials this generation. */
7581
+ topTrials: TrialTrace[];
7582
+ /** Worst-performing trials this generation — the missed-golden source. */
7583
+ bottomTrials: TrialTrace[];
7584
+ /** How many children the mutator should propose. */
7585
+ childCount: number;
7586
+ /** Optional: domain-specific mutation primitives the model can pick from. */
7587
+ mutationPrimitives?: string[];
7588
+ }
7589
+ declare const DEFAULT_MUTATION_PRIMITIVES: string[];
7590
+ /**
7591
+ * Build the LLM-ready reflection prompt. Output is plain text — pass it as
7592
+ * the user message. The system message should be small and stable (e.g.
7593
+ * "Output ONLY a JSON object matching the schema below.").
7594
+ */
7595
+ declare function buildReflectionPrompt(ctx: ReflectionContext): string;
7596
+ interface ReflectionProposal {
7597
+ label: string;
7598
+ rationale: string;
7599
+ payload: unknown;
7600
+ }
7601
+ declare function parseReflectionResponse(raw: string, maxProposals?: number): ReflectionProposal[];
7602
+
7603
+ /**
7604
+ * Multi-shot optimization adapter.
7605
+ *
7606
+ * This is the canonical bridge between variable-length agent trajectories
7607
+ * and `runPromptEvolution`. Apps provide four things:
7608
+ *
7609
+ * - variants: prompt/config/tool-policy candidates
7610
+ * - runner: executes one full task trajectory for a variant
7611
+ * - scorer: turns that trajectory into score + actionable side information
7612
+ * - mutator: proposes new variants from top/bottom scored trials
7613
+ *
7614
+ * The adapter owns the boring but easy-to-get-wrong glue: stable seeds,
7615
+ * score/cost objectives, error-to-trial conversion, ASI metric projection,
7616
+ * and optional paired holdout gating via `HeldOutGate`.
7617
+ */
7618
+
7619
+ type MultiShotSplit = 'search' | 'dev' | 'holdout';
7620
+ type AsiSeverity = 'info' | 'warning' | 'error' | 'critical';
7621
+ type MultiShotVariant<P = unknown> = EvolvableVariant<P>;
7622
+ interface ActionableSideInfo {
7623
+ /** Stable expectation/check id when available. */
7624
+ expectationId?: string;
7625
+ /** Human-readable diagnosis of what happened. */
7626
+ message: string;
7627
+ severity?: AsiSeverity;
7628
+ /** Concrete trace excerpt, file path, tool call, screenshot id, etc. */
7629
+ evidence?: string;
7630
+ /** Prompt/tool/context surface likely responsible. */
7631
+ responsibleSurface?: string;
7632
+ /** Suggested fix in natural language. */
7633
+ suggestion?: string;
7634
+ /** Whether this expectation was satisfied. Defaults to false for ASI rows. */
7635
+ matched?: boolean;
7636
+ metadata?: Record<string, unknown>;
7637
+ }
7638
+ interface MultiShotTrace {
7639
+ scenarioId: string;
7640
+ /** Full turn/tool trace. Shape is intentionally app-owned. */
7641
+ turns?: unknown[];
7642
+ toolCalls?: unknown[];
7643
+ artifacts?: unknown[];
7644
+ /** Compact final output or summary used by reflection prompts. */
7645
+ transcript?: string;
7646
+ output?: unknown;
7647
+ metadata?: Record<string, unknown>;
7648
+ }
7649
+ interface MultiShotRun {
7650
+ trace: MultiShotTrace;
7651
+ costUsd?: number;
7652
+ durationMs?: number;
7653
+ tokenUsage?: {
7654
+ input?: number;
7655
+ output?: number;
7656
+ cached?: number;
7657
+ };
7658
+ metadata?: Record<string, unknown>;
7659
+ }
7660
+ interface MultiShotRunInput<P = unknown> {
7661
+ variant: EvolvableVariant<P>;
7662
+ scenarioId: string;
7663
+ rep: number;
7664
+ split: MultiShotSplit;
7665
+ /** Stable paired seed for baseline/candidate comparisons. */
7666
+ seed: number;
7667
+ }
7668
+ interface MultiShotRunner<P = unknown> {
7669
+ run(input: MultiShotRunInput<P>): Promise<MultiShotRun> | MultiShotRun;
7670
+ }
7671
+ interface MultiShotScore {
7672
+ /** Primary score in [0,1]. The adapter clamps for safety. */
7673
+ score: number;
7674
+ /** Pass/fail for top/bottom trial selection. Defaults to true. */
7675
+ ok?: boolean;
7676
+ costUsd?: number;
7677
+ durationMs?: number;
7678
+ metrics?: Record<string, number>;
7679
+ asi?: ActionableSideInfo[];
7680
+ /** Optional rich output shown to reflection mutators. */
7681
+ emitted?: string;
7682
+ metadata?: Record<string, unknown>;
7683
+ }
7684
+ interface MultiShotScorer<P = unknown> {
7685
+ score(input: MultiShotRunInput<P> & {
7686
+ run: MultiShotRun;
7687
+ }): Promise<MultiShotScore> | MultiShotScore;
7688
+ }
7689
+ interface MultiShotTrialResult extends TrialResult {
7690
+ split: MultiShotSplit;
7691
+ seed: number;
7692
+ trace?: MultiShotTrace;
7693
+ asi?: ActionableSideInfo[];
7694
+ emitted?: string;
7695
+ metadata?: Record<string, unknown>;
7696
+ }
7697
+ interface MultiShotMutateAdapter<P = unknown> {
7698
+ mutate(args: {
7699
+ parent: EvolvableVariant<P>;
7700
+ parentAggregate: VariantAggregate;
7701
+ topTrials: MultiShotTrialResult[];
7702
+ bottomTrials: MultiShotTrialResult[];
7703
+ childCount: number;
7704
+ generation: number;
7705
+ }): Promise<EvolvableVariant<P>[]>;
7706
+ }
7707
+ interface MultiShotGateConfig<P = unknown> {
7708
+ /** Search rows are optional, but enable HeldOutGate's overfit-gap check. */
7709
+ searchScenarioIds?: string[];
7710
+ holdoutScenarioIds: string[];
7711
+ reps?: number;
7712
+ gate: HeldOutGateConfig;
7713
+ /** Convert scored trajectory runs into paper-grade RunRecords. */
7714
+ toRunRecord(input: {
7715
+ variant: EvolvableVariant<P>;
7716
+ scenarioId: string;
7717
+ rep: number;
7718
+ split: RunSplitTag;
7719
+ seed: number;
7720
+ trial: MultiShotTrialResult;
7721
+ }): RunRecord;
7722
+ }
7723
+ interface MultiShotOptimizationConfig<P = unknown> {
7724
+ runId: string;
7725
+ target: string;
7726
+ seedVariants: EvolvableVariant<P>[];
7727
+ searchScenarioIds: string[];
7728
+ reps: number;
7729
+ generations: number;
7730
+ populationSize: number;
7731
+ scoreConcurrency?: number;
7732
+ runner: MultiShotRunner<P>;
7733
+ scorer: MultiShotScorer<P>;
7734
+ mutateAdapter: MultiShotMutateAdapter<P>;
7735
+ objectives?: Objective<VariantAggregate>[];
7736
+ scalarWeights?: Record<string, number>;
7737
+ cache?: TrialCache;
7738
+ earlyStopOnNoImprovement?: boolean;
7739
+ seedBase?: number;
7740
+ onProgress?: (event: PromptEvolutionEvent) => void;
7741
+ gate?: MultiShotGateConfig<P>;
7742
+ }
7743
+ interface MultiShotGateResult {
7744
+ decision: GateDecision;
7745
+ candidateRuns: RunRecord[];
7746
+ baselineRuns: RunRecord[];
7747
+ }
7748
+ interface MultiShotOptimizationResult<P = unknown> {
7749
+ evolution: PromptEvolutionResult<P>;
7750
+ /** Best candidate on the optimizer-visible search split. */
7751
+ searchBestVariant: EvolvableVariant<P>;
7752
+ searchBestAggregate: VariantAggregate;
7753
+ /** Variant callers should actually ship after optional holdout gating. */
7754
+ promotedVariant: EvolvableVariant<P>;
7755
+ promotedAggregate: VariantAggregate;
7756
+ /** Null when no gate was configured or the search-best candidate was the baseline. */
7757
+ gate: MultiShotGateResult | null;
7758
+ }
7759
+ declare function runMultiShotOptimization<P>(config: MultiShotOptimizationConfig<P>): Promise<MultiShotOptimizationResult<P>>;
7760
+ declare function defaultMultiShotObjectives(): Objective<VariantAggregate>[];
7761
+ declare function trialTraceFromMultiShotTrial(trial: MultiShotTrialResult): TrialTrace;
7762
+
7672
7763
  /**
7673
7764
  * concurrency — small primitives the evolution loop needs.
7674
7765
  *
@@ -7849,7 +7940,7 @@ interface LineageNode {
7849
7940
  * that field is part of the audit-bench convention but cheap enough to
7850
7941
  * accept any payload that mirrors it. Override by passing your own.
7851
7942
  */
7852
- type LineageKindResolver<P> = (variant: PromptVariant<P>) => LineageKind;
7943
+ type LineageKindResolver<P> = (variant: EvolvableVariant<P>) => LineageKind;
7853
7944
  /**
7854
7945
  * Persistence shape:
7855
7946
  *
@@ -7874,7 +7965,7 @@ declare class LineageRecorder<P = unknown> {
7874
7965
  private readonly kindOf;
7875
7966
  constructor(path: string, kindOf?: LineageKindResolver<P>);
7876
7967
  upsert(node: LineageNode): Promise<void>;
7877
- upsertVariant(variant: PromptVariant<P>, opts?: {
7968
+ upsertVariant(variant: EvolvableVariant<P>, opts?: {
7878
7969
  omitPayload?: boolean;
7879
7970
  }): Promise<void>;
7880
7971
  snapshot(): LineageNode[];
@@ -8073,7 +8164,7 @@ interface CodeMutationOutcome {
8073
8164
  childId?: string;
8074
8165
  /** Free-form one-liner: "tightened tool descriptions in forge-tools.ts". */
8075
8166
  description?: string;
8076
- /** What the runner was trying to fix (carried into PromptVariant.rationale). */
8167
+ /** What the runner was trying to fix (carried into EvolvableVariant.rationale). */
8077
8168
  rationale?: string;
8078
8169
  /** Caller-defined diff payload. Mapped into the variant's payload by
8079
8170
  * `toVariantPayload`; agent-eval treats it as opaque. */
@@ -8090,7 +8181,7 @@ interface CodeMutationOutcome {
8090
8181
  }
8091
8182
  type CodeMutationRunner<T, P> = (args: {
8092
8183
  slot: PoolSlot<T>;
8093
- parent: PromptVariant<P>;
8184
+ parent: EvolvableVariant<P>;
8094
8185
  parentAggregate: VariantAggregate;
8095
8186
  topTrials: TrialResult[];
8096
8187
  bottomTrials: TrialResult[];
@@ -8105,15 +8196,15 @@ interface CreateSandboxCodeMutatorOpts<T, P> {
8105
8196
  * encode the diff however they want (file map, patch string, branch
8106
8197
  * ref, snapshot id) without agent-eval taking a stance.
8107
8198
  */
8108
- toVariantPayload(outcome: CodeMutationOutcome, parent: PromptVariant<P>): P;
8199
+ toVariantPayload(outcome: CodeMutationOutcome, parent: EvolvableVariant<P>): P;
8109
8200
  /** Optional telemetry sinks. */
8110
8201
  mutationTelemetry?: MutationTelemetry;
8111
8202
  costLedger?: CostLedger;
8112
8203
  lineage?: LineageRecorder<P>;
8113
8204
  /** Override id generation. Default: `${parent.id}.g${generation}.code.${i}`. */
8114
- childIdFor?(parent: PromptVariant<P>, generation: number, index: number): string;
8205
+ childIdFor?(parent: EvolvableVariant<P>, generation: number, index: number): string;
8115
8206
  /** Default label for the variant (visible in reports). */
8116
- labelFor?(outcome: CodeMutationOutcome, parent: PromptVariant<P>, generation: number, index: number): string;
8207
+ labelFor?(outcome: CodeMutationOutcome, parent: EvolvableVariant<P>, generation: number, index: number): string;
8117
8208
  }
8118
8209
  declare function createSandboxCodeMutator<T, P>(opts: CreateSandboxCodeMutatorOpts<T, P>): MutateAdapter<P>;
8119
8210
 
@@ -8316,71 +8407,4 @@ declare function judgeReplayGate<TOutput>(args: JudgeReplayGateArgs<TOutput>): P
8316
8407
  candidateSamples: number;
8317
8408
  }>;
8318
8409
 
8319
- /**
8320
- * Reflective mutation — primitives for trace-conditioned prompt rewriting.
8321
- *
8322
- * Used by `prompt-evolution.ts` (and any consumer running iterative
8323
- * improvement). Given a parent prompt + concrete trace evidence (top trials,
8324
- * bottom trials, missed expectations), produce an LLM-ready prompt that
8325
- * proposes targeted mutations — not blind rephrasings.
8326
- *
8327
- * Why this lives outside `prompt-evolution.ts`: any consumer that wants to
8328
- * run reflective rewriting WITHOUT the population/Pareto machinery can
8329
- * import these primitives directly.
8330
- *
8331
- * Quality bar (vs. naive "mutate this prompt"):
8332
- * - Show parent ↔ children diff, not just one variant
8333
- * - Quote specific missed goldens with their match phrases
8334
- * - Surface the model's actual emitted output side-by-side with what was expected
8335
- * - Quote concrete mutation primitives so the model has a vocabulary
8336
- */
8337
- interface TrialTrace {
8338
- /** Stable id for the trial — surfaces in the prompt for grounding. */
8339
- id: string;
8340
- /** Score the trial received on its primary metric. */
8341
- score: number;
8342
- /** Candidate inputs the agent was given (e.g., the fixture or scenario). */
8343
- inputName?: string;
8344
- /**
8345
- * Goldens / expectations this trial was tested against, with whether each
8346
- * was matched. The reflection prompt quotes the missed ones specifically.
8347
- */
8348
- expectations?: Array<{
8349
- id: string;
8350
- phrase: string;
8351
- matched: boolean;
8352
- }>;
8353
- /** Free-form text — what the agent actually emitted (e.g., findings, plan). */
8354
- emitted?: string;
8355
- /** Optional structured metrics (recall, precision, cost, latency). */
8356
- metrics?: Record<string, number>;
8357
- }
8358
- interface ReflectionContext {
8359
- /** What is being mutated — appears in the system prompt for orientation. */
8360
- target: string;
8361
- /** Current variant's payload — JSON-serialised for the prompt. */
8362
- parentPayload: unknown;
8363
- /** Best-performing trials this generation. */
8364
- topTrials: TrialTrace[];
8365
- /** Worst-performing trials this generation — the missed-golden source. */
8366
- bottomTrials: TrialTrace[];
8367
- /** How many children the mutator should propose. */
8368
- childCount: number;
8369
- /** Optional: domain-specific mutation primitives the model can pick from. */
8370
- mutationPrimitives?: string[];
8371
- }
8372
- declare const DEFAULT_MUTATION_PRIMITIVES: string[];
8373
- /**
8374
- * Build the LLM-ready reflection prompt. Output is plain text — pass it as
8375
- * the user message. The system message should be small and stable (e.g.
8376
- * "Output ONLY a JSON object matching the schema below.").
8377
- */
8378
- declare function buildReflectionPrompt(ctx: ReflectionContext): string;
8379
- interface ReflectionProposal {
8380
- label: string;
8381
- rationale: string;
8382
- payload: unknown;
8383
- }
8384
- declare function parseReflectionResponse(raw: string, maxProposals?: number): ReflectionProposal[];
8385
-
8386
- export { type ActionExecutionPolicy, type ActionPolicyDecision, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, type AlignmentOp, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, type Artifact$1 as Artifact, type ArtifactCheck, type Artifact as ArtifactCheckArtifact, type ArtifactResult, type ArtifactValidator, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, BENCHMARK_SPLIT_SEED, type BaselineOptions, type BaselineReport, BehaviorAssertion, type BenchmarkAdapter, type BenchmarkDatasetItem, type BenchmarkEvaluation, type BenchmarkReport, BenchmarkRunner, type BenchmarkRunnerConfig, type BestOfNResult, type BisectOptions, type BisectResult, type BisectStep, type BootstrapOptions, type BootstrapResult, BudgetBreachError, type BudgetBreachFinding, type BudgetBreachReport, BudgetGuard, type BudgetLedgerEntry, type BudgetSpec, BuilderSession, type BuilderSessionInit, type CalibrationBin, type CalibrationOptions, type CalibrationReport, type CalibrationResult, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateScenario, type CandidateScore, type CausalAttributionReport, type ChatSummary, type CheckResult, type CodeMutationOutcome, type CodeMutationRunner, type CollectedArtifacts, type CommandRunner, type CompletionCriterion, type CompositePolicy, type ConceptComplexity, type ConceptFinding, type ConceptSpec, type ConceptWeightStrategy, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, type ContractMetric, type ContractReport, type ControlActionFailureMode, type ControlActionOutcome, type ControlBudget, type ControlContext, type ControlDecision, type ControlEvalResult, type ControlRunResult, type ControlRuntimeConfig, type ControlRuntimeError, type ControlSeverity, type ControlStep, type ControlStopPolicies, ConvergenceTracker, type CorrelationReport, type CorrelationResult, type CorrelationStudyOptions, type CorrelationStudyResult, type CostEntry, CostLedger, type CostLedgerGeneration, type CostLedgerSnapshot, type CostSummary, CostTracker, type CounterfactualContext, type CounterfactualMutation, type CounterfactualResult, type CounterfactualRunner, type CreateCompositeMutatorOpts, type CreateDefaultReviewerOptions, type CreateSandboxCodeMutatorOpts, type CreateSandboxPoolOpts, type CrossTraceDiff, type CrossTraceDiffOptions, D1ExperimentStore, type D1ExperimentStoreOptions, type D1Like, type D1PreparedStatementLike, DEFAULT_AGENT_SLOS, DEFAULT_COMPLEXITY_WEIGHTS, DEFAULT_RULES as DEFAULT_FAILURE_RULES, DEFAULT_FINDERS, DEFAULT_HARNESS_OBJECTIVES, DEFAULT_MUTATION_PRIMITIVES, DEFAULT_MUTATORS, DEFAULT_REDACTION_RULES, DEFAULT_RED_TEAM_CORPUS, DEFAULT_RUN_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, Dataset, type DatasetDifficulty, type DatasetManifest, type DatasetProvenance, type DatasetScenario, type DatasetSplit, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DeploymentOutcome, type DirEntry, type Direction, type DivergenceOptions, type DivergenceReport, DockerSandboxDriver, type DriverResult, type DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type ErrorCountPattern, type EuRiskClass, type EvalMetricSpec, type EvalResult, type EventFilter, type EventKind, type EvolutionRound, type PromptVariant as EvolvableVariant, type ExecutorConfig, type Expectation, type Experiment, type ExperimentPlan, type ExperimentResult, type Run as ExperimentRun, type ExperimentStore, ExperimentTracker, type ExportedRewardModel, type ExtractOptions, type ExtractResult, FAILURE_CLASSES, type FactorContribution, type FactorialCell, type FailureClass, type FailureClassification, type FailureCluster, type FailureClusterReport, type FailureContext, type FailureMode, type FailureRule, type FeedbackArtifactType, type FeedbackAttempt, type FeedbackLabel, type FeedbackLabelKind, type FeedbackLabelSource, type FeedbackOptimizerRow, type FeedbackOutcome, type FeedbackPattern, type FeedbackReplayAdapter, type FeedbackReplayResult, type FeedbackSeverity, type FeedbackSplitPolicy, type FeedbackTask, type FeedbackTrajectory, type FeedbackTrajectoryFilter, type FeedbackTrajectoryStore, FileSystemExperimentStore, type FileSystemExperimentStoreOptions, FileSystemFeedbackTrajectoryStore, FileSystemOutcomeStore, type FileSystemOutcomeStoreOptions, FileSystemTraceStore, type FileSystemTraceStoreOptions, type Finding, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, type GainDistributionBin, type GainDistributionFigureSpec, type GainDistributionOptions, type GateDecision, type GateEvidence, type GenerationReport, type GenericSpan, type GoldenItem, type GoldenSeverity, type GoldenSpec, type GovernanceContext, type GovernanceFinding, type GovernanceReport, type GradedStep, type HarnessAdapter, type HarnessConfig, type HarnessExperimentConfig, type HarnessExperimentResult, type HarnessIntervention, type HarnessRunRequest, type HarnessRunResult, type HarnessScenario, type HarnessSelection, type HarnessVariant, type HarnessVariantReport, HeldOutGate, type HeldOutGateConfig, type HeldOutGateRejectionCode, HoldoutAuditor, HoldoutLockedError, type HostedJudgeConfig, type HostedJudgeDimension, type HostedJudgeRequest, type HostedJudgeResponse, type HostedRunCriticConfig, type HostedRunScoreRequest, type HostedRunScoreResponse, type HypothesisManifest, type HypothesisResult, INTENT_MATCH_JUDGE_VERSION, type ImageData, InMemoryExperimentStore, InMemoryFeedbackTrajectoryStore, InMemoryOutcomeStore, InMemoryTraceStore, InMemoryTrialCache, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JsonlTrialCache, type JudgeAgreementReport, type JudgeConfig, type JudgeFleetOptions, type JudgeFn, type JudgeInput, type JudgePair, type JudgeReplayGateArgs, type JudgeReplayResult, type JudgeRubric, JudgeRunner, type JudgeScore, type JudgeSpan, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, type Layer, type LayerCorrelation, type LayerResult, type LayerStatus, type LineageKind, type LineageKindResolver, type LineageNode, LineageRecorder, LlmCallError, type LlmCallRequest, type LlmCallResult, LlmClient, type LlmClientOptions, type LlmJsonCall, type LlmMessage, type LlmReviewerConfig, type LlmSpan, type LlmUsage, LockedJsonlAppender, MODEL_PRICING, type MatchResult, type MatcherResult, type MeasurementPolicy, type MergeOptions, type Message, type MetricSamples, type MetricVerdict, MetricsCollector, type MuffledFinder, type MuffledFinding, MultiLayerVerifier, type MultiToolchainLayerConfig, type MutateAdapter, type MutationAttempt, type MutationChannel, MutationTelemetry, type Mutator, Mutex, NoopResearcher, OTEL_AGENT_EVAL_SCOPE, type Objective, type OptimizationConfig, type OptimizationExample, OptimizationLoop, type OptimizationLoopConfig, type OptimizationLoopResult, type OptimizationResult, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, type OtlpExport, type OtlpResourceSpans, type OtlpSpan, type OutcomeFilter, type OutcomePair, type OutcomeStore, type PairedBootstrapOptions, type PairedBootstrapResult, type PairwiseComparison, PairwiseSteeringOptimizer, type ParetoFigureSpec, type ParetoPoint, type ParetoResult, type PersonaConfig, type Playbook, type PlaybookEntry, type PoolSlot, type PositionalBiasResult, type PreferenceMemoryEntry, type PrmGradedTrace, PrmGrader, type PrmTrainingSample, ProductClient, type ProductClientConfig, type ProjectKind, ProjectRegistry, type ProjectSummary, type ProjectTimelineEntry, type PromptEvolutionConfig, type PromptEvolutionEvent, type PromptEvolutionResult, type PromptHandle, PromptOptimizer, PromptRegistry, type TrialResult as PromptTrialResult, type PromptVariant$1 as PromptVariant, type ProposeFn, type ProposeInput, type ProposeOutput, type ProposeReviewConfig, type ProposeReviewControlAction, type ProposeReviewControlConfig, type ProposeReviewControlResult, type ProposeReviewControlState, type ProposeReviewReport, type ProposeReviewShot, type ProposedSideEffect, REDACTION_VERSION, type RedTeamCase, type RedTeamCategory, type RedTeamFinding, type RedTeamPayload, type RedTeamReport, type RedactionReport, type RedactionRule, type ReferenceMatchResult, type ReferenceReplayAdapter, type ReferenceReplayAdapterFn, type ReferenceReplayAdapterLike, type ReferenceReplayAggregate, type ReferenceReplayCandidate, type ReferenceReplayCase, type ReferenceReplayCaseRun, type ReferenceReplayExecutionScenario, type ReferenceReplayItem, type ReferenceReplayMatch, type ReferenceReplayMatchStrategy, type ReferenceReplayMatcher, type ReferenceReplayPromotionDecision, type ReferenceReplayPromotionPolicy, type ReferenceReplayRun, type ReferenceReplayRunContext, type ReferenceReplayRunOptions, type ReferenceReplayRunStore, type ReferenceReplayScenario, type ReferenceReplayScenarioScore, type ReferenceReplayScore, type ReferenceReplayScoreOptions, type ReferenceReplaySplit, type ReferenceReplaySplitComparison, type ReferenceReplaySteeringRowsOptions, type ReflectionContext, type ReflectionProposal, type RegressionOptions, type RegressionSpec, type Researcher, type RetrievalSpan, type Review, type ReviewFn, type ReviewInput, type ReviewMemoryEntry, type ReviewMemoryStore, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RouteMap, type RubricDimension, type Run$1 as Run, type RunAppScenarioOptions, type RunCommandInput, type RunCommandResult, type RunConfig, RunCritic, type RunCriticOptions, type RunDiff, type RunFilter, type RunJudgeMetadata, type RunLayer, type RunOutcome, type RunRecord, RunRecordValidationError, type RunScore, type RunScoreWeights, type RunSplitTag, type RunStatus, type RunTokenUsage, type RunTrace, SEMANTIC_CONCEPT_JUDGE_VERSION, type SandboxDriver, SandboxHarness, type SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type SandboxResult, type SandboxSpan, type ScanOptions, type Scenario, type ScenarioAggregate, type ScenarioCost, type ScenarioFile, ScenarioRegistry, type ScenarioResult, type ScoreAdapter, type ScoredTarget, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SelfPreferenceResult, type SemanticConceptJudgeInput, type SemanticConceptJudgeOptions, type SemanticConceptJudgeResult, type SeriesConvergenceOptions, type SeriesConvergenceResult, type Severity, type ShipOptions, type SignedManifest, type SliceOptions, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, type Span, type SpanBase, type SpanFilter, type SpanHandle, type SpanKind, type SpanStatus, type SteeringBundle, type SteeringChange, type SteeringDelta, type SteeringEvaluation, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type SteeringRolePrompt, type SteeringVariantReport, type StepAttribution, type StepContext, type StepRubric, type StopDecision, type StuckLoopFinding, type StuckLoopOptions, type StuckLoopReport, SubprocessSandboxDriver, type SubprocessSandboxDriverOptions, type SummaryTable, type SummaryTableOptions, type SummaryTableRow, type SynthesisReason, type SynthesisTarget, TRACE_SCHEMA_VERSION, type TestGradedRunOptions, type TestGradedRunResult, type TestGradedScenario, type TestOutputParser, type TestResult, type ThreeLayerProjectReport, type ThresholdContract, TokenCounter, type TokenSpec, type ToolSpan, type ToolStats, type ToolUseMetrics, type ToolUseOptions, type ToolWasteFinding, type ToolWasteOptions, type ToolWasteReport, TraceEmitter, type TraceEmitterOptions, type TraceEvent, type TraceStore, type Trajectory, type TrajectoryStep, type TrialAttempt, type TrialCache, TrialTelemetry, type TrialTrace, type Turn, type TurnMetrics, type TurnResult, UNIVERSAL_FINDERS, type UseCaseSignals, type ValidationContext, type ValidationIssue, type ValidationResult, type VariantAggregate, type VariantScore, type VerbosityBiasResult, type Verdict, type Verification, type VerificationReport, type VerifyContext, type VerifyFn, type VerifyOptions, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkflowTopology, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, adversarialJudge, aggregateLlm, aggregateRunScore, allCriticalPassed, analyzeAntiSlop, analyzeSeries, argHash, assignFeedbackSplit, attributeCounterfactuals, deterministicSplit as benchmarkDeterministicSplit, index as benchmarks, benjaminiHochberg, bhAdjust, bisect, bonferroni, bootstrapCi, budgetBreachView, buildReflectionPrompt, buildReviewerPrompt, buildTrajectory, byteLengthRange, calibrateJudge, calibrationCurve, callLlm, callLlmJson, canaryLeakView, causalAttribution, checkCanaries, checkSlos, clamp01, classifyEuAiRisk, classifyFailure, codeExecutionJudge, cohensD, coherenceJudge, collectionPreserved, commitBisect, compareReferenceReplay, compareToBaseline, compilerJudge, composeParsers, composeValidators, computeToolUseMetrics, confidenceInterval, containsAll, controlFailureClassFromVerification, controlRunToFeedbackTrajectory, correlateLayers, correlationStudy, createAntiSlopJudge, createCompositeMutator, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createFeedbackTrajectory, createIntentMatchJudge, createLlmReviewer, createSandboxCodeMutator, createSandboxPool, createSemanticConceptJudge, crossTraceDiff, crowdingDistance, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultJudges, defaultReferenceReplayMatcher, deployGateLayer, distillPlaybook, dominates, estimateCost, estimateTokens, euAiActReport, evaluateActionPolicy, evaluateContract, evaluateHypothesis, evaluateOracles, executeScenario, expectAgent, exportRewardModel, exportRunAsOtlp, exportTrainingData, extractAssetUrls, extractErrorCount, failureClusterView, feedbackTrajectoriesToDatasetScenarios, feedbackTrajectoriesToOptimizerRows, feedbackTrajectoryToDatasetScenario, feedbackTrajectoryToOptimizerRow, fileContains, fileExists, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findSkipCountsAsPass, firstDivergenceView, flowLayer, formatBenchmarkReport, formatDriverReport, formatFindings, gainHistogram, precision as goldenPrecision, gradeSemanticStatus, groupBy, hashContent, hashScenarios, htmlContainsElement, inMemoryReferenceReplayStore, inMemoryReviewStore, interRaterReliability, iqr, isJudgeSpan, isLlmSpan, isPrmVerdict, isRetrievalSpan, isRunRecord, isSandboxSpan, isToolSpan, jestTestParser, jsonHasKeys, jsonShape, jsonlReferenceReplayStore, jsonlReviewStore, judgeAgreementView, judgeReplayGate, judgeSpans, keyPreserved, linterJudge, llmSpanFromProvider, llmSpans, loadScorerFromGrader, localCommandRunner, lowercaseMutator, mannWhitneyU, matchGoldens, mergeLayerResults, mergeSteeringBundle, multiToolchainLayer, nistAiRmfReport, nonRefusalRubric, normalizeScores, notBlocked, objectiveEval, outputLengthRubric, pairedBootstrap, pairedTTest, pairedWilcoxon, paraphraseRobustness, paretoChart, paretoFrontier, paretoFrontierWithCrowding, parseFeedbackTrajectoriesJsonl, parseReflectionResponse, parseRunRecordSafe, partialCredit, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, positionalBias, printDriverSummary, prmBestOfN, prmEnsembleBestOfN, probeLlm, promptBisect, proposeSynthesisTargets, pytestTestParser, redTeamDataset, redTeamReport, redactString, redactValue, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatch, regexMatches, regressionView, renderMarkdown, renderMarkdownReport, renderPlaybookMarkdown, renderPreferenceMemoryMarkdown, renderSteeringText, replayFeedbackTrajectories, replayFeedbackTrajectory, replayScorerOverCorpus, replayTraceThroughJudge, requiredSampleSize, resetLockedAppendersForTesting, resumeBuilderSession, roundTripRunRecord, rowCount, rowWhere, runAgentControlLoop, runAssertions, runCanaries, runCounterfactual, runE2EWorkflow, runExpectations, runFailureClass, runHarnessExperiment, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runPromptEvolution, runProposeReview, runProposeReviewAsControlLoop, runReferenceReplay, runSelfPlay, runSemanticConceptJudge, runTestGradedScenario, runsForScenario, scalarScore, scanForMuffledGates, scoreAllProjects, scoreContinuity, scoreProject, scoreRedTeamOutput, scoreReferenceReplay, securityJudge, selectHarnessVariant, selfPreference, sentenceReorderMutator, serializeFeedbackTrajectoriesJsonl, signManifest, soc2Report, statusAdvanced, stopOnNoProgress, stopOnRepeatedAction, stripFencedJson, stuckLoopView, subjectiveEval, summarize, summarizeHarnessResults, summarizePreferenceMemory, summaryTable, testJudge, textInSnapshot, toLangfuseEnvelope, toNdjson, toPrometheusText, toolIntentAlignmentRubric, toolNamesForRun, toolNonRedundantRubric, toolSpans, toolSuccessRubric, toolWasteView, typoMutator, urlContains, validateRunRecord, verbosityBias, verifyManifest, visualDiff, viteDeployRunner, vitestTestParser, weightedMean, weightedRecall, welchsTTest, whitespaceCollapseMutator, wilcoxonSignedRank, withAssignedFeedbackSplit, wranglerDeployRunner };
8410
+ export { type ActionExecutionPolicy, type ActionPolicyDecision, type ActionableSideInfo, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, type AlignmentOp, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, type Artifact$1 as Artifact, type ArtifactCheck, type Artifact as ArtifactCheckArtifact, type ArtifactResult, type ArtifactValidator, type AsiSeverity, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, BENCHMARK_SPLIT_SEED, type BaselineOptions, type BaselineReport, BehaviorAssertion, type BenchmarkAdapter, type BenchmarkDatasetItem, type BenchmarkEvaluation, type BenchmarkReport, BenchmarkRunner, type BenchmarkRunnerConfig, type BestOfNResult, type BisectOptions, type BisectResult, type BisectStep, type BootstrapOptions, type BootstrapResult, BudgetBreachError, type BudgetBreachFinding, type BudgetBreachReport, BudgetGuard, type BudgetLedgerEntry, type BudgetSpec, BuilderSession, type BuilderSessionInit, type CalibrationBin, type CalibrationOptions, type CalibrationReport, type CalibrationResult, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateScenario, type CandidateScore, type CausalAttributionReport, type ChatSummary, type CheckResult, type CodeMutationOutcome, type CodeMutationRunner, type CollectedArtifacts, type CommandRunner, type CompletionCriterion, type CompositePolicy, type ConceptComplexity, type ConceptFinding, type ConceptSpec, type ConceptWeightStrategy, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, type ContractMetric, type ContractReport, type ControlActionFailureMode, type ControlActionOutcome, type ControlBudget, type ControlContext, type ControlDecision, type ControlEvalResult, type ControlRunResult, type ControlRuntimeConfig, type ControlRuntimeError, type ControlSeverity, type ControlStep, type ControlStopPolicies, ConvergenceTracker, type CorrelationReport, type CorrelationResult, type CorrelationStudyOptions, type CorrelationStudyResult, type CostEntry, CostLedger, type CostLedgerGeneration, type CostLedgerSnapshot, type CostSummary, CostTracker, type CounterfactualContext, type CounterfactualMutation, type CounterfactualResult, type CounterfactualRunner, type CreateCompositeMutatorOpts, type CreateDefaultReviewerOptions, type CreateSandboxCodeMutatorOpts, type CreateSandboxPoolOpts, type CrossTraceDiff, type CrossTraceDiffOptions, D1ExperimentStore, type D1ExperimentStoreOptions, type D1Like, type D1PreparedStatementLike, DEFAULT_AGENT_SLOS, DEFAULT_COMPLEXITY_WEIGHTS, DEFAULT_RULES as DEFAULT_FAILURE_RULES, DEFAULT_FINDERS, DEFAULT_HARNESS_OBJECTIVES, DEFAULT_MUTATION_PRIMITIVES, DEFAULT_MUTATORS, DEFAULT_REDACTION_RULES, DEFAULT_RED_TEAM_CORPUS, DEFAULT_RUN_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, Dataset, type DatasetDifficulty, type DatasetManifest, type DatasetProvenance, type DatasetScenario, type DatasetSplit, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DeploymentOutcome, type DirEntry, type Direction, type DivergenceOptions, type DivergenceReport, DockerSandboxDriver, type DriverResult, type DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type ErrorCountPattern, type EuRiskClass, type EvalMetricSpec, type EvalResult, type EventFilter, type EventKind, type EvolutionRound, type EvolvableVariant, type ExecutorConfig, type Expectation, type Experiment, type ExperimentPlan, type ExperimentResult, type Run as ExperimentRun, type ExperimentStore, ExperimentTracker, type ExportedRewardModel, type ExtractOptions, type ExtractResult, FAILURE_CLASSES, type FactorContribution, type FactorialCell, type FailureClass, type FailureClassification, type FailureCluster, type FailureClusterReport, type FailureContext, type FailureMode, type FailureRule, type FeedbackArtifactType, type FeedbackAttempt, type FeedbackLabel, type FeedbackLabelKind, type FeedbackLabelSource, type FeedbackOptimizerRow, type FeedbackOutcome, type FeedbackPattern, type FeedbackReplayAdapter, type FeedbackReplayResult, type FeedbackSeverity, type FeedbackSplitPolicy, type FeedbackTask, type FeedbackTrajectory, type FeedbackTrajectoryFilter, type FeedbackTrajectoryStore, FileSystemExperimentStore, type FileSystemExperimentStoreOptions, FileSystemFeedbackTrajectoryStore, FileSystemOutcomeStore, type FileSystemOutcomeStoreOptions, FileSystemTraceStore, type FileSystemTraceStoreOptions, type Finding, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, type GainDistributionBin, type GainDistributionFigureSpec, type GainDistributionOptions, type GateDecision, type GateEvidence, type GenerationReport, type GenericSpan, type GoldenItem, type GoldenSeverity, type GoldenSpec, type GovernanceContext, type GovernanceFinding, type GovernanceReport, type GradedStep, type HarnessAdapter, type HarnessConfig, type HarnessExperimentConfig, type HarnessExperimentResult, type HarnessIntervention, type HarnessRunRequest, type HarnessRunResult, type HarnessScenario, type HarnessSelection, type HarnessVariant, type HarnessVariantReport, HeldOutGate, type HeldOutGateConfig, type HeldOutGateRejectionCode, HoldoutAuditor, HoldoutLockedError, type HostedJudgeConfig, type HostedJudgeDimension, type HostedJudgeRequest, type HostedJudgeResponse, type HostedRunCriticConfig, type HostedRunScoreRequest, type HostedRunScoreResponse, type HypothesisManifest, type HypothesisResult, INTENT_MATCH_JUDGE_VERSION, type ImageData, InMemoryExperimentStore, InMemoryFeedbackTrajectoryStore, InMemoryOutcomeStore, InMemoryTraceStore, InMemoryTrialCache, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JsonlTrialCache, type JudgeAgreementReport, type JudgeConfig, type JudgeFleetOptions, type JudgeFn, type JudgeInput, type JudgePair, type JudgeReplayGateArgs, type JudgeReplayResult, type JudgeRubric, JudgeRunner, type JudgeScore, type JudgeSpan, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, type Layer, type LayerCorrelation, type LayerResult, type LayerStatus, type LineageKind, type LineageKindResolver, type LineageNode, LineageRecorder, LlmCallError, type LlmCallRequest, type LlmCallResult, LlmClient, type LlmClientOptions, type LlmJsonCall, type LlmMessage, type LlmReviewerConfig, type LlmSpan, type LlmUsage, LockedJsonlAppender, MODEL_PRICING, type MatchResult, type MatcherResult, type MeasurementPolicy, type MergeOptions, type Message, type MetricSamples, type MetricVerdict, MetricsCollector, type MuffledFinder, type MuffledFinding, MultiLayerVerifier, type MultiShotGateConfig, type MultiShotGateResult, type MultiShotMutateAdapter, type MultiShotOptimizationConfig, type MultiShotOptimizationResult, type MultiShotRun, type MultiShotRunInput, type MultiShotRunner, type MultiShotScore, type MultiShotScorer, type MultiShotSplit, type MultiShotTrace, type MultiShotTrialResult, type MultiShotVariant, type MultiToolchainLayerConfig, type MutateAdapter, type MutationAttempt, type MutationChannel, MutationTelemetry, type Mutator, Mutex, NoopResearcher, OTEL_AGENT_EVAL_SCOPE, type Objective, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, type OtlpExport, type OtlpResourceSpans, type OtlpSpan, type OutcomeFilter, type OutcomePair, type OutcomeStore, type PairedBootstrapOptions, type PairedBootstrapResult, PairwiseSteeringOptimizer, type ParetoFigureSpec, type ParetoPoint, type ParetoResult, type PersonaConfig, type Playbook, type PlaybookEntry, type PoolSlot, type PositionalBiasResult, type PreferenceMemoryEntry, type PrmGradedTrace, PrmGrader, type PrmTrainingSample, ProductClient, type ProductClientConfig, type ProjectKind, ProjectRegistry, type ProjectSummary, type ProjectTimelineEntry, type PromptEvolutionConfig, type PromptEvolutionEvent, type PromptEvolutionResult, type PromptHandle, PromptRegistry, type TrialResult as PromptTrialResult, type ProposeFn, type ProposeInput, type ProposeOutput, type ProposeReviewConfig, type ProposeReviewControlAction, type ProposeReviewControlConfig, type ProposeReviewControlResult, type ProposeReviewControlState, type ProposeReviewReport, type ProposeReviewShot, type ProposedSideEffect, REDACTION_VERSION, type RedTeamCase, type RedTeamCategory, type RedTeamFinding, type RedTeamPayload, type RedTeamReport, type RedactionReport, type RedactionRule, type ReferenceMatchResult, type ReferenceReplayAdapter, type ReferenceReplayAdapterFn, type ReferenceReplayAdapterLike, type ReferenceReplayAggregate, type ReferenceReplayCandidate, type ReferenceReplayCase, type ReferenceReplayCaseRun, type ReferenceReplayExecutionScenario, type ReferenceReplayItem, type ReferenceReplayMatch, type ReferenceReplayMatchStrategy, type ReferenceReplayMatcher, type ReferenceReplayPromotionDecision, type ReferenceReplayPromotionPolicy, type ReferenceReplayRun, type ReferenceReplayRunContext, type ReferenceReplayRunOptions, type ReferenceReplayRunStore, type ReferenceReplayScenario, type ReferenceReplayScenarioScore, type ReferenceReplayScore, type ReferenceReplayScoreOptions, type ReferenceReplaySplit, type ReferenceReplaySplitComparison, type ReferenceReplaySteeringRowsOptions, type ReflectionContext, type ReflectionProposal, type RegressionOptions, type RegressionSpec, type Researcher, type RetrievalSpan, type Review, type ReviewFn, type ReviewInput, type ReviewMemoryEntry, type ReviewMemoryStore, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RouteMap, type RubricDimension, type Run$1 as Run, type RunAppScenarioOptions, type RunCommandInput, type RunCommandResult, type RunConfig, RunCritic, type RunCriticOptions, type RunDiff, type RunFilter, type RunJudgeMetadata, type RunLayer, type RunOutcome, type RunRecord, RunRecordValidationError, type RunScore, type RunScoreWeights, type RunSplitTag, type RunStatus, type RunTokenUsage, type RunTrace, SEMANTIC_CONCEPT_JUDGE_VERSION, type SandboxDriver, SandboxHarness, type SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type SandboxResult, type SandboxSpan, type ScanOptions, type Scenario, type ScenarioAggregate, type ScenarioCost, type ScenarioFile, ScenarioRegistry, type ScenarioResult, type ScoreAdapter, type ScoredTarget, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SelfPreferenceResult, type SemanticConceptJudgeInput, type SemanticConceptJudgeOptions, type SemanticConceptJudgeResult, type SeriesConvergenceOptions, type SeriesConvergenceResult, type Severity, type ShipOptions, type SignedManifest, type SliceOptions, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, type Span, type SpanBase, type SpanFilter, type SpanHandle, type SpanKind, type SpanStatus, type SteeringBundle, type SteeringChange, type SteeringDelta, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type SteeringRolePrompt, type StepAttribution, type StepContext, type StepRubric, type StopDecision, type StuckLoopFinding, type StuckLoopOptions, type StuckLoopReport, SubprocessSandboxDriver, type SubprocessSandboxDriverOptions, type SummaryTable, type SummaryTableOptions, type SummaryTableRow, type SynthesisReason, type SynthesisTarget, TRACE_SCHEMA_VERSION, type TestGradedRunOptions, type TestGradedRunResult, type TestGradedScenario, type TestOutputParser, type TestResult, type ThreeLayerProjectReport, type ThresholdContract, TokenCounter, type TokenSpec, type ToolSpan, type ToolStats, type ToolUseMetrics, type ToolUseOptions, type ToolWasteFinding, type ToolWasteOptions, type ToolWasteReport, TraceEmitter, type TraceEmitterOptions, type TraceEvent, type TraceStore, type Trajectory, type TrajectoryStep, type TrialAttempt, type TrialCache, TrialTelemetry, type TrialTrace, type Turn, type TurnMetrics, type TurnResult, UNIVERSAL_FINDERS, type UseCaseSignals, type ValidationContext, type ValidationIssue, type ValidationResult, type VariantAggregate, type VerbosityBiasResult, type Verdict, type Verification, type VerificationReport, type VerifyContext, type VerifyFn, type VerifyOptions, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkflowTopology, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, adversarialJudge, aggregateLlm, aggregateRunScore, allCriticalPassed, analyzeAntiSlop, analyzeSeries, argHash, assignFeedbackSplit, attributeCounterfactuals, deterministicSplit as benchmarkDeterministicSplit, index as benchmarks, benjaminiHochberg, bhAdjust, bisect, bonferroni, bootstrapCi, budgetBreachView, buildReflectionPrompt, buildReviewerPrompt, buildTrajectory, byteLengthRange, calibrateJudge, calibrationCurve, callLlm, callLlmJson, canaryLeakView, causalAttribution, checkCanaries, checkSlos, clamp01, classifyEuAiRisk, classifyFailure, codeExecutionJudge, cohensD, coherenceJudge, collectionPreserved, commitBisect, compareReferenceReplay, compareToBaseline, compilerJudge, composeParsers, composeValidators, computeToolUseMetrics, confidenceInterval, containsAll, controlFailureClassFromVerification, controlRunToFeedbackTrajectory, correlateLayers, correlationStudy, createAntiSlopJudge, createCompositeMutator, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createFeedbackTrajectory, createIntentMatchJudge, createLlmReviewer, createSandboxCodeMutator, createSandboxPool, createSemanticConceptJudge, crossTraceDiff, crowdingDistance, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultJudges, defaultMultiShotObjectives, defaultReferenceReplayMatcher, deployGateLayer, distillPlaybook, dominates, estimateCost, estimateTokens, euAiActReport, evaluateActionPolicy, evaluateContract, evaluateHypothesis, evaluateOracles, executeScenario, expectAgent, exportRewardModel, exportRunAsOtlp, exportTrainingData, extractAssetUrls, extractErrorCount, failureClusterView, feedbackTrajectoriesToDatasetScenarios, feedbackTrajectoriesToOptimizerRows, feedbackTrajectoryToDatasetScenario, feedbackTrajectoryToOptimizerRow, fileContains, fileExists, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findSkipCountsAsPass, firstDivergenceView, flowLayer, formatBenchmarkReport, formatDriverReport, formatFindings, gainHistogram, precision as goldenPrecision, gradeSemanticStatus, groupBy, hashContent, hashScenarios, htmlContainsElement, inMemoryReferenceReplayStore, inMemoryReviewStore, interRaterReliability, iqr, isJudgeSpan, isLlmSpan, isPrmVerdict, isRetrievalSpan, isRunRecord, isSandboxSpan, isToolSpan, jestTestParser, jsonHasKeys, jsonShape, jsonlReferenceReplayStore, jsonlReviewStore, judgeAgreementView, judgeReplayGate, judgeSpans, keyPreserved, linterJudge, llmSpanFromProvider, llmSpans, loadScorerFromGrader, localCommandRunner, lowercaseMutator, mannWhitneyU, matchGoldens, mergeLayerResults, mergeSteeringBundle, multiToolchainLayer, nistAiRmfReport, nonRefusalRubric, normalizeScores, notBlocked, objectiveEval, outputLengthRubric, pairedBootstrap, pairedTTest, pairedWilcoxon, paraphraseRobustness, paretoChart, paretoFrontier, paretoFrontierWithCrowding, parseFeedbackTrajectoriesJsonl, parseReflectionResponse, parseRunRecordSafe, partialCredit, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, positionalBias, printDriverSummary, prmBestOfN, prmEnsembleBestOfN, probeLlm, promptBisect, proposeSynthesisTargets, pytestTestParser, redTeamDataset, redTeamReport, redactString, redactValue, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatch, regexMatches, regressionView, renderMarkdown, renderMarkdownReport, renderPlaybookMarkdown, renderPreferenceMemoryMarkdown, renderSteeringText, replayFeedbackTrajectories, replayFeedbackTrajectory, replayScorerOverCorpus, replayTraceThroughJudge, requiredSampleSize, resetLockedAppendersForTesting, resumeBuilderSession, roundTripRunRecord, rowCount, rowWhere, runAgentControlLoop, runAssertions, runCanaries, runCounterfactual, runE2EWorkflow, runExpectations, runFailureClass, runHarnessExperiment, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runMultiShotOptimization, runPromptEvolution, runProposeReview, runProposeReviewAsControlLoop, runReferenceReplay, runSelfPlay, runSemanticConceptJudge, runTestGradedScenario, runsForScenario, scalarScore, scanForMuffledGates, scoreAllProjects, scoreContinuity, scoreProject, scoreRedTeamOutput, scoreReferenceReplay, securityJudge, selectHarnessVariant, selfPreference, sentenceReorderMutator, serializeFeedbackTrajectoriesJsonl, signManifest, soc2Report, statusAdvanced, stopOnNoProgress, stopOnRepeatedAction, stripFencedJson, stuckLoopView, subjectiveEval, summarize, summarizeHarnessResults, summarizePreferenceMemory, summaryTable, testJudge, textInSnapshot, toLangfuseEnvelope, toNdjson, toPrometheusText, toolIntentAlignmentRubric, toolNamesForRun, toolNonRedundantRubric, toolSpans, toolSuccessRubric, toolWasteView, trialTraceFromMultiShotTrial, typoMutator, urlContains, validateRunRecord, verbosityBias, verifyManifest, visualDiff, viteDeployRunner, vitestTestParser, weightedMean, weightedRecall, welchsTTest, whitespaceCollapseMutator, wilcoxonSignedRank, withAssignedFeedbackSplit, wranglerDeployRunner };