/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * @file The `source` identifiers that recipe outputs write, under their retired and current spellings. * * A recipe-output `source` is a wire identifier rather than prose. It is the literal value of the `source` column on * every row of every built corpus, the key a training config's `source_weights`, `source_reps`, * `augment_exclude_sources` and `required_corpus_receipts[].source` address this value. `overlay-manifest` records * the `--source` label per file. Published model cards also quote the string. A rename requires a data migration * across every corpus that stores it. This table retains both spellings while an archived corpus or historical * config records the older one. * * The retired spelling is `synth-`. It was read as "synthetic", and most of the rows it labels are real * published records written in a layout: `synth-german` stores `register: openaddresses` and `surface: composed`. * The current spelling is `-`, where the operation states what the recipe did to attested data. * The tail is kept byte-for-byte, so the mapping is a prefix swap in either direction. * * The prefix states the recipe's operation. That value stays constant per source. It omits `surface`, a row property that * varies within a source. It also omits the register because `requireRegister` makes that an invocation property. * * Every recipe reads its default `source` from this table through {@linkcode defaultRecipeSource}, and * {@linkcode WRITE_CURRENT_SOURCE_NAMES} decides which spelling it answers with. An assembly rewrites its routed * overlays through this table before `overlay-manifest` runs, so the rows and the recipe defaults move together. */ /** * What a recipe did to attested data to produce its rows. * * This describes the operation behind a source's id. * The row's `surface` is a separate field that `SurfaceOrigin` in `#types` records, * and the two spell `rendered` for different classifications. * * A `rendered-*` source records `SurfaceOrigin.Composed`, because `renderLocaleRow` draws * on the row's house number and postcode and takes an order, so it varies the written form * rather than writing one canonical form per record. * `SurfaceOrigin.Rendered` belongs to an adapter that writes that one form. */ export declare const SourceOperation: { /** * One real record, written in a layout its country uses, with the form varied across rows. */ readonly Rendered: "rendered"; /** * Part of one real record. */ readonly Fragment: "fragment"; /** * A real record with a drawn component added. */ readonly Spliced: "spliced"; /** * No real record behind the row. */ readonly Invented: "invented"; /** * A string copied verbatim from `@mailwoman/codex`. */ readonly Codex: "codex"; /** * Rows a person wrote and checked. */ readonly Reviewed: "reviewed"; }; /** * One of the {@link SourceOperation} values. */ export type SourceOperation = (typeof SourceOperation)[keyof typeof SourceOperation]; /** * One recipe-output source under both spellings. */ export interface RecipeSource { /** * The spelling recipes wrote through 2026-09-26. * * Every corpus assembled before that date stores this spelling. */ retired: string; /** * The spelling a corpus assembled after the rewrite stores and a training config keys on. */ current: string; operation: SourceOperation; /** * The file that writes the rows, relative to `packages/corpus/lib/` * unless the value specifies another root. */ producer: string; /** * Why the producer's path does not fully explain the placement. */ note?: string; } /** * Every recipe-output source that a corpus on disk, a training config * or a recipe default has spelled `synth-*`. * * Measured on 2026-09-26 over `/mnt/mw/corpus/versioned/`: 46 values on disk, * 47 keys across 226 configs and the recipe defaults. * This list is their union. */ export declare const RECIPE_SOURCES: ReadonlyArray; /** * Overlay sources that are not recipe outputs and keep their spelling. * * Each is either a register's own name, used by an adapter or builder that reads that * register by construction, or an adversarial set whose producer chose the name. * They are listed so a check over training configs can tell a source that * exists from one that a sweep invented. */ export declare const CARRIED_SOURCES: ReadonlyArray; /** * The current spelling of a recipe-output source given either spelling, * or `null` for a source this table does not record. * * A caller rewriting a corpus must refuse on `null` rather than pass the value through, because a * pass-through leaves a corpus carrying two vocabularies with no record of which files were touched. */ export declare function currentSourceName(source: string): string | null; /** * The table entry a source belongs to, under either spelling. */ export declare function recipeSource(source: string): RecipeSource | null; /** * The spelling a recipe writes today, given the retired spelling it has always written. * * Every recipe's default `source` reads this rather than holding a literal, so the * vocabulary is one constant rather than 26 files. {@linkcode WRITE_CURRENT_SOURCE_NAMES} * decides which spelling it answers with. * It must agree with the corpus that a recipe output joins. * * @throws When the table records no entry for `retired`. * A pass-through would let a typo become a source ID on every row of a built corpus. * `wire-identifiers` catches that failure later. * This function catches it at the call. */ export declare function defaultRecipeSource(retired: string): string; /** * Whether a recipe writes the operation spelling or the retired one. * * True since 2026-09-28, because the rewrite has run. * `v0.7.0-overlay-staging` records 43 distinct sources, each under an operation prefix. * * Its `source-names.json` records the mapping applied per file with the row count * and the ordered-`source_id` digest verified on both sides. * `v0.7.0-de-holdout/corpus-v0.7.0-de-holdout` is assembled from those bytes over 766 slices. * * A recipe writing the retired spelling from here on would produce an output * disagreeing with the corpus it joins. * * `v0.6.0-register-surface` and the staging directory's `.pre-rename` copy are never rewritten in place. * The configs that target them keep the spelling their corpus stores. */ export declare const WRITE_CURRENT_SOURCE_NAMES = true; /** * The retired spelling of a recipe-output source given either spelling, or the value unchanged. * * `RECIPE_SURFACES` and `OVERLAY_REGISTERS` key on the retired spelling. * Both refuse a source they do not record. * * A corpus rewritten to the current spelling would therefore make each of them * throw on every row in the corpus. * * Callers of those two tables resolve the key through this, so a lookup answers under * either spelling and a genuinely unknown source still refuses. * * The value is returned unchanged for a source outside the table — an adapter id, * or an overlay source id — because those tables are keyed by whatever the producer emits. */ export declare function retiredSourceName(source: string): string; /** * Every recipe-output spelling and adapter source id this table knows. * * Adapter ids are not here. * They are declared by each adapter as `_ADAPTER_ID`, and a reader that needs * the full set of stored `source` values joins the two. */ export declare function knownOverlaySourceNames(): ReadonlySet; //# sourceMappingURL=sources.d.ts.map