/** * `cleo decide bench` as one core operation (T12495): build or reuse the * dataset, apply owner corrections, draw the spot-check sample and — unless * `sampleOnly` — run the providers and write the results and the report. * * Files, all in `outDir` (default `/.cleo/decide-bench/`, which * git ignores): * * - `dataset.jsonl` — the labelled, redacted rows. Reused on later calls so * the owner's corrections stick; `rebuild` builds it again from the stores. * - `spot-check.json` — the stratified sample for the owner. * - `results.json` / `report.md` — written by a run. * * Dataset building, corrections and sampling never contact a provider. * * @task T12495 * @epic T12486 */ import type { SpendLedger } from '../spend.js'; import type { DecideFetch } from '../transport.js'; import { type BenchDatasetSizes } from './dataset.js'; import { type BenchProfileResolver } from './profiles.js'; import { type BenchAggregateRow, type BenchSpendSummary } from './runner.js'; import { type BenchCorrectionsReceipt } from './spot-check.js'; import { type BenchConnection, type BenchSite, type BenchSource } from './types.js'; /** Dataset file name inside the output directory. */ export declare const BENCH_DATASET_FILE = "dataset.jsonl"; /** Spot-check file name inside the output directory. */ export declare const BENCH_SPOT_CHECK_FILE = "spot-check.json"; /** Results file name inside the output directory. */ export declare const BENCH_RESULTS_FILE = "results.json"; /** Report fragment file name inside the output directory. */ export declare const BENCH_REPORT_FILE = "report.md"; /** Invalid benchmark input (maps to a validation error in the CLI). */ export declare class DecideBenchInputError extends Error { /** How to fix it. */ readonly fix: string; /** * @param message - What is wrong. * @param fix - How to fix it. */ constructor(message: string, fix: string); } /** Input of {@link runDecideBenchOperation}. */ export interface DecideBenchInput { /** Project whose stores are read. Default: the resolved project root. */ readonly projectRoot?: string; /** Output directory. Default `/.cleo/decide-bench`. */ readonly outDir?: string; /** Profile names to compare (required unless `sampleOnly`). */ readonly profiles?: readonly string[]; /** Sites to sample and run. Default: all. */ readonly sites?: readonly string[]; /** Build the dataset and the sample only; no provider is contacted. */ readonly sampleOnly?: boolean; /** Owner corrections file to apply before sampling. */ readonly correctionsPath?: string; /** Hard total spend cap in US dollars. Default $5. */ readonly maxUsd?: number; /** Repeated runs. Default 1. */ readonly runs?: number; /** Rows per batch call. */ readonly batchSize?: number; /** Rebuild the dataset from the stores even when one exists. */ readonly rebuild?: boolean; /** PRNG seed for negatives and the sample. */ readonly seed?: number; /** Spot-check sample size. Default 30. */ readonly sampleSize?: number; /** Store port (tests). Default: the core accessors. */ readonly source?: BenchSource; /** Profile resolver (tests). Default: the T12733 profile store, then the env override layer. */ readonly resolver?: BenchProfileResolver; /** Explicit connections; skip profile resolution. */ readonly connections?: readonly BenchConnection[]; /** Transport (tests). */ readonly fetch?: DecideFetch; /** Directory for per-connection provider-state files (tests). */ readonly providerStateDir?: string; /** Monthly ledger to record spend in; `null` skips. Default: the file ledger. */ readonly spendLedger?: SpendLedger | null; } /** Output of {@link runDecideBenchOperation}. */ export interface DecideBenchSummary { /** Output directory. */ readonly outDir: string; /** Files written or reused. */ readonly files: { readonly dataset: string; readonly spotCheck: string; readonly results?: string; readonly report?: string; }; /** Whether an existing dataset was reused. */ readonly datasetReused: boolean; /** Dataset sizes (all sites). */ readonly dataset: BenchDatasetSizes; /** Sites sampled and run. */ readonly sites: readonly BenchSite[]; /** Items in the spot-check sample. */ readonly spotCheckItems: number; /** Applied corrections, when a file was given. */ readonly corrections?: BenchCorrectionsReceipt; /** Whether providers were run. */ readonly ran: boolean; /** Spend, when run. */ readonly spend?: BenchSpendSummary; /** Mean and spread per provider × site, when run. */ readonly aggregate?: readonly BenchAggregateRow[]; } /** * Run `cleo decide bench`. * * @param input - Flags and wiring. * @returns What was written and, after a run, the spend and the aggregate. * @throws DecideBenchInputError on invalid input (unknown site or profile, no profiles). */ export declare function runDecideBenchOperation(input?: DecideBenchInput): Promise; //# sourceMappingURL=operation.d.ts.map