import type { AddressKeyRow } from "#utils/address-key"; /** * The attribute name an evaluation-group file declares. */ export declare const EVALUATION_GROUPS_ATTRIBUTE = "evaluation-groups"; /** * A source whose records join a group by address as well as by record id. * * A source that issues an address a new record id on a re-ingest writes one address * under two groups, so a frozen address would train under its new id. * The key joins them (#3125). */ export interface GroupAddressKeySource { /** * The row's address key, or null when the row lacks a part of the key. */ key(row: AddressKeyRow): string | null; /** * A coarser key every row of one address shares. * A column scan can compute it. */ block(row: AddressKeyRow): string | null; /** * {@linkcode GroupAddressKeySource.block} as a DuckDB expression over a corpus file aliased `alias`. */ blockSQL(alias: string): string; } /** * The sources whose group identity includes an address key, by corpus `source`. * * Every other source groups by record id only. * * NAD's releases issue a resubmitted address a new UUID (#3125). * An `overture-latam` row's id hashes its components, so the re-run that adds the region * and regroups the postcode issues every row a new id (#3457). */ export declare const GROUP_ADDRESS_KEY_SOURCES: Readonly>; /** * A row as {@linkcode groupAddressKeyOf} reads it. */ export type AddressKeyedRow = AddressKeyRow & { source: string; }; /** * The address key of a row whose source {@linkcode GROUP_ADDRESS_KEY_SOURCES} lists, * prefixed by the source, or null for any other row and for a row that lacks a part of the key. */ export declare function groupAddressKeyOf(row: AddressKeyedRow): string | null; /** * Whether a row's address key is one a frozen set holds, so the row joins that frozen group. * * A caller that holds no address row matches by record id only. */ export declare function frozenByAddress(row: AddressKeyedRow | null | undefined, frozen: { addressKeys?: ReadonlySet; }): boolean; /** * The frozen side of the evaluation-group policy as a split reads it: the groups, * and the address keys when the list holds any. */ export type FrozenGroups = Pick & { addressKeys?: ReadonlySet; }; /** * Whether a row belongs to a frozen group: by its group, or by its address * key ({@linkcode frozenByAddress}). */ export declare function isFrozenRow(group: string, address: AddressKeyedRow | null | undefined, frozen: FrozenGroups): boolean; /** * One frozen set the group list was derived from. */ export interface EvaluationGroupDataset { datasetID: string; version: string; /** * What the set was drawn from: a corpus manifest, or the lineage of a probe render no corpus holds. */ drawnFrom: EvaluationGroupSource; /** * The sha256 of the dataset manifest read. */ manifestSHA256: string; rows: number; groups: number; } /** * The corpus manifest or render lineage a frozen set records as `drawnFrom`. */ export interface EvaluationGroupSource { corpusVersion: string | null; sha256: string; } /** * The committed file: every frozen group, sorted. * * Each set records its own `drawnFrom`, so one list can join sets drawn from a corpus * with capability-probe sets rendered outside every corpus. * `evaluation-groups.v0.8.18.json` predates that field and records one top-level * `drawnFrom` for its two sets. * * It stays as written, because corpus v0.8.19's split policy hash records its sha256. */ export interface EvaluationGroupsFile { attribute: typeof EVALUATION_GROUPS_ATTRIBUTE; datasets: EvaluationGroupDataset[]; groups: string[]; /** * The {@linkcode groupAddressKeyOf} key of every frozen row whose source has one, sorted. * * A list written before #3125 has none. */ addressKeys?: string[]; } /** * The lookup a split applies, with the identity its policy hash records. */ export interface EvaluationGroups { path: string; sha256: string; datasets: readonly EvaluationGroupDataset[]; groups: ReadonlySet; addressKeys: ReadonlySet; } /** * What a split policy hash and a split record state about the group list applied. */ export interface EvaluationGroupsIdentity { sha256: string; datasets: Array>; groups: number; /** * Recorded only when the list holds address keys, so the identity of a list without them is unchanged. */ addressKeys?: number; } /** * The identity of a group list: its file's sha256, the frozen sets it names, * its group count and its address-key count. */ export declare function evaluationGroupsIdentity(groups: Pick & { addressKeys?: ReadonlySet; }): EvaluationGroupsIdentity; /** * One training receipt whose required groups a held-out draw skipped. */ export interface RequiredGroupReceipt { receipt: "prominent_place_coverage"; /** * The places table the receipt reads, as the training config names it. */ places: string; places_sha256: string; required_places: number; /** * Decile-1 places outside the receipt's requirement. * * The prominent-places recipe may write demand rows for them, so the draw skips their groups too. * A skip recorded before they were read records none. */ writable_places?: number; } /** * What a held-out draw (a freeze, a reserve or the validation quota) skipped * because a training receipt requires the groups in train: the receipts it read, * and the required groups its pool held, by country. */ export interface RequiredGroupSkip { receipts: RequiredGroupReceipt[]; requiredRecords: number; /** * Groups of another record or source whose train rows write a required form, when the draw read them. */ requiredFormGroups?: number; skippedGroups: number; /** * Skipped groups per country of the pool's rows, sorted by country. */ byCountry: Record; } /** * The group of one corpus row: its `base_source_id` when it was derived from a base row, * else its own `source_id`, read up to the last `#`. * * The held-out freeze (`heldoutRowGroup`) and the overlap audit key on the same value. */ export declare function evaluationGroupOf(row: { source_id: string; base_source_id?: string | null; }): string; /** * Builds the committed file from each frozen set's groups. */ export declare function buildEvaluationGroupsFile(input: { datasets: ReadonlyArray & { groups: Iterable; }>; /** * The frozen rows whose address keys the list records, read with {@linkcode groupAddressKeyOf}. */ keyedRows?: Iterable; }): EvaluationGroupsFile; /** * Reads an evaluation-group file into the lookup a split applies. * * @throws When the file declares another attribute, names no frozen set or lists no group. */ export declare function readEvaluationGroups(path: string): Promise; /** * The committed group list of the v0.8.18 frozen sets (`heldout-dev-v0.8.18` and `heldout-confirm-v0.8.18`). */ export declare function evaluationGroupsV0818Path(): string; /** * The committed group list of the v0.8.18 frozen sets and the v0.8.19 capability-probe * sets (`heldout-dev-v0.8.19-probes-r2` and `heldout-confirm-v0.8.19-probes-r2`). */ export declare function evaluationGroupsV0819Path(): string; //# sourceMappingURL=evaluation-groups.d.ts.map