/** * Darwin — Experiment Tracker * * Records experiments, aggregates stats, and computes composite scores * for prompt version evaluation. */ import type { DarwinExperiment, MemoryProvider, MetricWeights, PromptVersionStats } from '../types.js'; import type { CategoryStats } from './optimizer.js'; export declare class ExperimentTracker { private memory; constructor(memory: MemoryProvider); /** * Record a completed experiment. * Saves it to memory, updates the prompt version stats, and adjusts * the consecutive-failure counter in Darwin state. */ recordExperiment(exp: DarwinExperiment): Promise; /** * Aggregate stats from all experiments for a given agent (optionally * filtered to a single prompt version). */ getStats(agentName: string, version?: string): Promise; /** * Calculate a composite score for a single experiment. * * Normalization ranges: * quality — score / 10 (0-10 scale) * sourceCount — min(count / 20, 1) (20 sources = perfect) * outputLength — min(len / 10000, 1) (10k chars = perfect) * duration — 1 - min(ms/300000, 1) (lower is better, 5 min cap) * success — 1 if true, 0 if false */ getCompositeScore(exp: DarwinExperiment, weights?: MetricWeights): number; /** * Get stats broken down by task category (P2-5). * Gives the optimizer visibility into which topic types perform well/poorly. */ getStatsByCategory(agentName: string): Promise; /** * Average composite score across experiments for a specific agent + prompt version. * * If `since` is provided, only experiments after that ISO timestamp are included. * This is critical for A/B tests: compare only the test period, not all-time data * (otherwise the incumbent version's historical data skews the comparison). */ getAverageComposite(agentName: string, version: string, weights?: MetricWeights, since?: string): Promise; /** * v0.7.0 — Per-experiment composite scores for a specific agent + prompt * version, in chronological order. Unlike {@link getAverageComposite} this * does NOT collapse to a scalar — it feeds the sequential * confidence gate (mSPRT / Hoeffding), which needs the individual samples * (and therefore their variance), not just the mean. * * If `since` is provided, only experiments at/after that ISO timestamp are * included — pass the A/B test start so the incumbent's historical runs do * not skew the comparison (same convention as {@link getAverageComposite}). */ getCompositeScores(agentName: string, version: string, weights?: MetricWeights, since?: string): Promise; /** * v0.6.0 — Average raw metric vector for a specific agent + prompt version, * keyed by the names in `DarwinMetrics` / `DARWIN_DEFAULT_OBJECTIVES` * (`qualityScore` / `sourceCount` / `outputLength` / `durationMs`). Unlike * {@link getAverageComposite}, this does NOT collapse to a scalar — it * feeds the multi-objective Pareto-dominance gate at A/B activation so a * scalar winner that regressed on one objective can be caught. * * `qualityScore` averages only over experiments that actually have a score * (NULL = critic failed, excluded — same convention as `getStats`). Other * objectives average over all filtered experiments. Returns `{}` when there * are no experiments for the version (caller treats empty as "skip gate"). * * If `since` is provided, only experiments at/after that ISO timestamp are * included — pass the A/B test start so the incumbent's historical data * does not skew the comparison. */ getAverageMetrics(agentName: string, version: string, since?: string): Promise>; /** * v0.7.0 — Per-task-type composite scores for a specific agent + prompt * version, keyed by `taskType`. This is the `perKeyScores` map GEPA Algorithm * 2 coverage selection consumes (one "key" per task type, higher is better): * it lets the loop prefer the prompt version that performs best across the * MOST DIFFERENT task types, not just the highest single average. * * Each value is the mean composite (same {@link getCompositeScore} used * everywhere else) over that version's experiments of that task type. Returns * `{}` when the version has no experiments. `since` filters to a time window * exactly like the sibling helpers. */ getPerKeyScoresByCategory(agentName: string, version: string, weights?: MetricWeights, since?: string): Promise>; } //# sourceMappingURL=tracker.d.ts.map