import { sha256 } from '../compile-cache/identity.js'; import type { HeldoutApproval, HeldoutAttempt, HeldoutBundle, HeldoutCorpus, HeldoutExecution, HeldoutPreregistration, HeldoutRequest, HeldoutRow, Study } from './types.js'; export { sha256 as heldoutDigest }; export declare const HELDOUT_CAP_USD: Readonly>; export declare const HELDOUT_PORTFOLIO_CAP_USD = 48; export declare const HELDOUT_ENV_GATE = "AIWG_DECISION_HELDOUT_LIVE"; export declare class HeldoutError extends Error { readonly category: string; readonly detail?: string | undefined; /** `detail` names where (for example a corpus row index), never row content. */ constructor(category: string, detail?: string | undefined); } export declare function checkHeldoutSchema(kind: 'Corpus' | 'Preregistration' | 'Approval' | 'Attempt' | 'Event' | 'Summary' | 'Frozen' | 'Baseline' | 'SpendEvent' | 'SpendHead' | 'CalibrationPhase', value: unknown): void; export declare function validateHeldoutInputs(corpus: HeldoutCorpus, plan: HeldoutPreregistration): void; export declare function heldoutExecution(corpus: HeldoutCorpus, plan: HeldoutPreregistration, approval: Pick, request: HeldoutRequest): HeldoutExecution; export declare function heldoutExecutionDigest(corpus: HeldoutCorpus, plan: HeldoutPreregistration, approval: HeldoutApproval): `sha256:${string}`; export declare function validateHeldoutBundle(bundle: HeldoutBundle, trustedApprovalDigest: string): void; /** Input-only pricing: Jev has no remote generation limit, so paid output is inadmissible. */ export declare function heldoutReservationMicros(a: HeldoutApproval, inputTokenBound: number): number; export declare function heldoutReservationTokens(plan: HeldoutPreregistration, inputTokenBound: number): number; export declare function heldoutRowsInScope(bundle: HeldoutBundle): HeldoutRow[]; export declare function heldoutRequest(corpus: HeldoutCorpus, plan: HeldoutPreregistration, approval: HeldoutApproval, row: HeldoutRow, request: HeldoutRequest): Promise<{ execution: HeldoutExecution; requestDigest: `sha256:${string}`; requestBytes: number; estimatedTokens: number; }>; /** * The request a row would send and its preregistered size bound, for any row * of the corpus whatever the current phase. Only sizing and planning call it * directly; dispatch goes through heldoutRequest, which also checks the phase. */ export declare function heldoutRequestSize(corpus: HeldoutCorpus, plan: HeldoutPreregistration, approval: HeldoutApproval, row: HeldoutRow, request: HeldoutRequest): Promise<{ execution: HeldoutExecution; requestDigest: `sha256:${string}`; requestBytes: number; estimatedTokens: number; }>; /** * Sizes every request of every corpus row, in every split, against the * preregistered per-request bound and refuses (`payload-bound`, naming the row * index) before any provider call. A staged run therefore learns at its * calibration phase, before any spend, that a later phase could not dispatch. */ export declare function assertHeldoutRequestBounds(corpus: HeldoutCorpus, plan: HeldoutPreregistration, approval: HeldoutApproval): Promise; /** Prior observations are reusable only within the same study, corpus and preregistration. */ export declare function heldoutResumeAttempts(bundle: HeldoutBundle, prior: readonly HeldoutAttempt[]): { old: HeldoutAttempt[]; latest: Map; }; /** The collector and dry-run reserve only unfinished requests, with their unspent retry allowance. */ export declare function heldoutPendingRequests(row: HeldoutRow, plan: HeldoutPreregistration, latest: ReadonlyMap): { request: HeldoutRequest; first: number; attempts: number; }[]; export declare function planHeldoutCollection(bundle: HeldoutBundle, digest: string, prior?: readonly HeldoutAttempt[]): Promise<{ calibration: import("./types.js").HeldoutCalibration; rowsInScope: string[]; providerCalls: number; maximumAttempts: number; maximumRequestEstimateTokens: number; reservedTokens: number; reservedUsdMicros: number; fitsBeforeStop: boolean; }>; /** An intentionally unapproved, unpriced form. Unknown attestations stay null, never fixture approvals. */ export declare function heldoutApprovalTemplate(corpus: HeldoutCorpus, plan: HeldoutPreregistration): { schemaVersion: string; approved: boolean; study: Study; runId: null; reviewer: null; approvalReference: null; sourceCommit: null; exactHeadCi: null; stagingHost: string; stagingWorkspace: null; model: string; servedModel: string; region: null; credentialRef: null; credentialResolverDigest: null; corpusDigest: `sha256:${string}`; preregistrationDigest: `sha256:${string}`; executionDigest: null; calibration: { mode: string; } | null; providerTermsReference: null; priceBound: { inputUsdPerMTok: null; outputUsdPerMTok: null; perRequestUsd: null; evidenceReferences: never[]; approvalReference: null; }; budget: { calls: number; tokens: number; usd: number; }; priorStudySpendUsd: null; priorPortfolioSpendUsd: null; }; export declare function validateHeldoutAttempt(attempt: HeldoutAttempt): void; //# sourceMappingURL=contract.d.ts.map