/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * @file The align phase reads each adapter's canonical rows and applies license and register refusals. * It expands synthesis and aligns each row. It then routes the result to a split or quarantine. * * The phase appends to four files. It writes a checkpoint at each adapter boundary, allowing an interrupted * build to resume at the next adapter without aligning earlier adapters again. */ import type { PathBuilder } from "path-ts"; import type { BuildProfile, BuildStage } from "#build/types"; import { type AdapterRunManifest } from "#runner"; import { type LicensePolicy, type LicenseRefusalKind, type LicenseVerdictCache } from "#utils/license"; import { type CountryHoldout, type SplitName } from "#utils/split"; export interface AlignPhaseOptions { /** * The adapter runs to align, in the order their rows enter the output files. */ adapterRuns: readonly AdapterRunManifest[]; corpusVersion: string; synthesize: boolean; profile: BuildProfile; licensePolicy: LicensePolicy; excludeLicenses: readonly RegExp[]; holdouts: Record; /** * Each register source's ingest-eligibility reasons, or `null` under the exploratory profile. */ eligibility: ReadonlyMap | null; labeledPaths: Record; quarantinePath: PathBuilder; checkpointPath: PathBuilder; onProgress?: (stage: BuildStage, message: string) => void; } /** * The counts produced by the align phase. * * The build uses them in its manifest and frozen source record. */ export interface AlignPhaseResult { aligned: number; quarantined: number; counts: Record; licenseCounts: Map; refusedByKind: Map; /** * Rows the license policy refused, counted per `source`. * * A source here contributed zero rows to the corpus whatever its adapter reported writing, which is * the distinction between a source present in corpus provenance and one present in model provenance. */ refusedBySource: Map; excludedByLicense: number; admittedUnresolved: number; excludedByEligibility: number; rowsBySource: Map; ineligibleSources: Map; /** * The license cache used by this phase. * * Its `refusedValues()` method returns every value it refused. */ licenses: LicenseVerdictCache; } /** * Align every adapter run's rows into the four output files, writing a checkpoint at each adapter boundary. */ export declare function runAlignPhase(opts: AlignPhaseOptions): Promise; //# sourceMappingURL=align.d.ts.map