/**
 * Causal attribution via factorial experiments.
 *
 * Run every combination of {model × prompt × scenario × seed}, then
 * decompose observed score variance into main effects + interactions.
 * Moves from correlational "variant B is better" to causal "the model
 * swap accounts for 42% of the lead; the prompt change accounts for 28%;
 * interaction is 30%."
 *
 * Minimal implementation: 2-way factorial (two factors at a time) with
 * main-effect + interaction decomposition via variance of cell means.
 * Consumers run the factorial design themselves (we don't schedule
 * runs); this module consumes the (factorLevels, observedScores)
 * table and does the attribution math.
 */
export interface FactorialCell {
    /** Map factor name → level id. e.g. { model: 'claude', prompt: 'v2' } */
    levels: Record<string, string>;
    /** Observed score for this cell (mean over replications if n > 1). */
    score: number;
    /** Number of replications averaged to produce `score`. */
    n: number;
}
export interface FactorContribution {
    factor: string;
    /** Variance attributed to this factor's main effect, as a fraction of total. */
    shareOfVariance: number;
    /** Range of cell means across levels of this factor. */
    range: number;
}
export interface InteractionContribution {
    factors: [string, string];
    shareOfVariance: number;
}
export interface CausalAttributionReport {
    totalVariance: number;
    mainEffects: FactorContribution[];
    interactions: InteractionContribution[];
    /** Residual = variance unexplained by main effects + modeled interactions. */
    residualShare: number;
    /** Sanity: shares sum to 1 (within fp). */
    sharesSum: number;
}
export declare function causalAttribution(cells: FactorialCell[]): CausalAttributionReport;
//# sourceMappingURL=causal-attribution.d.ts.map