/** * @file Best-of-N self-consistency for decision tasks. A noisy small model * varies run-to-run; sampling the same prompt several times and taking the * majority vote collapses that variance into a stable verdict. `key` maps * each sample's data to the value being voted on. */ /** * One attempt's outcome from a task runner. */ export interface TaskResult { readonly ok: boolean; readonly data?: T | undefined; readonly error?: string | undefined; readonly raw?: string | undefined; } /** * Pick the most frequent successful sample by `key`. Filters to `ok` samples * with data, tallies them, and returns the result whose key wins the vote. Ties * break to the earliest-sampled key (deterministic — the first key to reach the * max wins). With no successful sample, returns the last result, or a synthetic * failure when `results` is empty. */ export declare function majorityResult(results: ReadonlyArray>, key: (data: T) => string): TaskResult;