import type { PathBuilder } from "path-ts"; import type { BuildStage } from "#build/types"; import type { DuckDBLimits } from "#parquet/duckdb"; import { type HoldoutSpanFinding } from "#tools/overlay/held-out-spans"; import type { CountryHoldout } from "#utils/split"; /** * The parquet manifest's name while the check hasn't admitted it. */ export declare const UNCHECKED_PARQUET_MANIFEST_FILE = "MANIFEST.unchecked.json"; /** * The parquet manifest's name once the check admitted it, the name every reader of a corpus opens. */ export declare const PARQUET_MANIFEST_FILE = "MANIFEST.json"; /** * The check's receipt, written beside the manifest on every outcome. */ export declare const HOLDOUT_CHECK_FILE = "HOLDOUT_CHECK.json"; /** * What the check read and found, as {@linkcode HOLDOUT_CHECK_FILE} records it. */ export interface HoldoutCheckRecord { checked_at: string; /** * The countries whose declared holdouts were checked, sorted. */ countries: string[]; files_read: number; findings: HoldoutSpanFinding[]; /** * True when `findings` is empty and the manifest was admitted. */ admitted: boolean; } /** * Moves an admitted manifest back under its unchecked name when a build resumes, so the parquet * writer reads the files it recorded and the check admits the manifest again at the end. * * With no admitted manifest, or with a staged one already present, the directory is left as it is. */ export declare function stageAdmittedManifestForResume(corpusDir: PathBuilder): Promise; export interface AdmitParquetManifestOptions { /** * The corpus directory holding the staged manifest, `/corpus-v`. */ corpusDir: PathBuilder; holdouts: Record; limits?: DuckDBLimits; onProgress?: (stage: BuildStage, message: string) => void; } /** * Runs the held-out span check over the staged parquet manifest, writes the receipt, * and moves the manifest to {@linkcode PARQUET_MANIFEST_FILE} when the check passes. * * A manifest already admitted, with no staged manifest beside it, is read as admitted by an earlier run * and checked again in place, so a resumed build reports the same receipt a fresh one would. * * @throws When the check finds a declared key in training or a region whose * train supply fell below the floor. * The staged manifest stays under its unchecked name and the receipt lists every finding. */ export declare function admitParquetManifest(opts: AdmitParquetManifestOptions): Promise; //# sourceMappingURL=holdout-check.d.ts.map