import type { RunSummary } from "../runDirectory/list.js"; /** * Statistics over one batch: one suite invocation where every test ran the * same number of trials. A test's mean and standard error come from its * trials; the batch's accuracy is the mean over every scored run, and its * standard error is taken over the per-trial batch means, paired by trial * index (trial 1 of every test is one sample), the way a leaderboard reports * "accuracy ± SE over k trials". Nothing here is stored: it is recomputed * from run summaries wherever they live. */ export type TestStatistics = { testId: string; trials: number; /** Mean score over the scored trials; null when none has a score. */ mean: number | null; /** Sample standard deviation / √n; null below two scored trials. */ standardError: number | null; meanCostUsd: number; meanDurationMs: number; }; export type BatchStatistics = { /** The shared batch id; null for a lone run from before batches existed. */ batch: string | null; tests: TestStatistics[]; trials: number; /** Mean score over every scored run in the batch; null when none has one. */ accuracy: number | null; /** Sample standard deviation of the per-trial batch means / √k; null below two trials. */ standardError: number | null; totalCostUsd: number; totalDurationMs: number; }; /** Split runs into batches by their batch id (a run without one is a batch * of its own), in first-seen order, and compute each batch's statistics. */ export declare function batchStatisticsByBatch(runs: readonly RunSummary[]): BatchStatistics[]; /** A batch that could not be scored as a whole (an uneven trial grid — a run * cut short by the batch cost cap or an interrupt — or mixed ids), with the * reason `batchStatistics` gave. */ export type IncompleteBatch = { batch: string | null; reason: string; }; /** Like `batchStatisticsByBatch`, but a batch that `batchStatistics` refuses * is reported rather than thrown, so one incomplete batch never hides the * others' statistics. */ export declare function batchStatisticsByBatchTolerant(runs: readonly RunSummary[]): { batches: BatchStatistics[]; incomplete: IncompleteBatch[]; }; /** Statistics for exactly one complete batch. Refuses an empty input, runs * from different batches, more than one run without a batch id, and any * incomplete trial grid: every test must have trials exactly `1..k` for one * `k`, so a pairing by trial index is always between real trials. */ export declare function batchStatistics(runs: readonly RunSummary[]): BatchStatistics;