/**
 * 4-tier scoring engine — unified scoring across all evaluation modes.
 *
 * Tier 1: Assertion-level (atomic pass/fail + optional numeric score)
 * Tier 2: Dimension-level (aggregated per scoring dimension)
 * Tier 3: Task-level (weighted composite of dimensions)
 * Tier 4: Suite/Area-level (aggregated across tasks)
 *
 * This engine is mode-agnostic — it works for literacy, MCP server,
 * agent harness, knowledge probe, and custom modes.
 *
 * @see docs/design-docs/architecture-overhaul/scoring-rubrics-assertions.md
 */
/** The result of a single assertion evaluation */
export interface AssertionScore {
    /** Whether the assertion passed */
    pass: boolean;
    /** Numeric score in [0, 1], null if not applicable */
    score: number | null;
    /** Human-readable explanation */
    reason: string;
    /** Assertion type that produced this result */
    assertionType: string;
    /** Dimension this assertion contributes to */
    dimension: string;
    /** Wall-clock grading time in ms */
    latencyMs: number;
    /** Weight of this assertion (1.0 if unspecified) */
    weight: number;
}
/** Aggregation strategy for dimension scoring */
export type AggregationStrategy = "max" | "mean" | "min" | "weighted-mean";
/** Aggregated score for a scoring dimension */
export interface DimensionScore {
    /** Dimension identifier (e.g., "code-correctness") */
    dimensionId: string;
    /** Human-readable label */
    label: string;
    /** Aggregated score in [0, 1] */
    score: number;
    /** How many assertions contributed */
    assertionCount: number;
    /** How many assertions passed */
    passCount: number;
    /** Aggregation method used */
    aggregation: AggregationStrategy;
    /** Individual assertion results */
    assertions: AssertionScore[];
}
/**
 * Aggregate assertion scores into dimension scores.
 *
 * Groups assertions by dimension, then applies the configured aggregation
 * strategy (default: weighted-mean).
 */
export declare function aggregateDimensions(assertions: AssertionScore[], options?: {
    defaultAggregation?: AggregationStrategy;
    dimensionLabels?: Record<string, string>;
}): DimensionScore[];
/** Weighted composite score for a task */
export interface TaskScore {
    /** Task identifier */
    taskId: string;
    /** Feature area (e.g., "groq", "studio"). When absent, aggregateAreas() falls back to taskId prefix. */
    area?: string;
    /** Weighted composite score in [0, 1] */
    score: number;
    /** Per-dimension breakdown */
    dimensions: DimensionScore[];
    /** Weight configuration used */
    weights: Record<string, number>;
    /** Source of weights (default profile, task override, etc.) */
    weightSource: string;
    /** Whether the task met its quality threshold */
    passesThreshold: boolean;
    /** The threshold compared against */
    threshold: number;
    /** Warnings about potential misconfiguration (e.g., no dimensions matched weights) */
    warnings?: string[];
}
/** Options for computing a task score */
export interface TaskScoreOptions {
    /** Task identifier */
    taskId: string;
    /** Feature area (e.g., "groq", "studio"). Falls back to taskId prefix if omitted. */
    area?: string;
    /** Dimension weights (must sum to ~1.0) */
    weights: Record<string, number>;
    /** Where the weights came from (for traceability) */
    weightSource?: string;
    /** Quality threshold (0-1) for pass/fail gate */
    threshold?: number;
}
/**
 * Compute a weighted task score from dimension scores.
 */
export declare function computeTaskScore(dimensions: DimensionScore[], options: TaskScoreOptions): TaskScore;
/** Aggregated score across tasks in a feature area */
export interface AreaScore {
    /** Area identifier (e.g., "groq", "studio") */
    areaId: string;
    /** Mean task score */
    score: number;
    /** Number of tasks evaluated */
    taskCount: number;
    /** Number of tasks passing threshold */
    passingTaskCount: number;
    /** Per-task breakdown */
    tasks: TaskScore[];
    /** Trend vs previous evaluation */
    delta: number | null;
}
/**
 * Aggregate task scores into area scores.
 */
export declare function aggregateAreas(tasks: TaskScore[], previousScores?: Record<string, number>): AreaScore[];
/**
 * Normalize an assertion score to [0, 1] range.
 *
 * Different assertion types produce scores in different ranges:
 * - Boolean (contains, equals, regex): 0 or 1
 * - LLM rubric: 0-100 (needs /100)
 * - similar: 0-1 (already normalized)
 * - javascript/python: user-defined (assumed 0-1)
 */
export declare function normalizeScore(rawScore: number, assertionType: string): number;
/** Grader transition configuration for gradual migration */
export interface GraderTransitionConfig {
    /** Current (old) grader model */
    old: string;
    /** New grader model to transition to */
    new_: string;
    /** ISO date after which old grader is retired */
    expiration: string;
    /** Whether to run both graders in parallel */
    parallel: boolean;
}
/** Ensemble grading configuration */
export interface EnsembleGradingConfig {
    /** Whether ensemble grading is enabled */
    enabled: boolean;
    /** Grader models to use */
    models: string[];
    /** Aggregation strategy for ensemble scores */
    aggregation: "max" | "mean" | "median";
}
/**
 * Compute ensemble score from multiple grader outputs.
 */
export declare function computeEnsembleScore(scores: number[], aggregation?: "max" | "mean" | "median"): {
    score: number;
    agreement: number;
};
