/** * Config-level `` groups: making a TUPLE unique across rows. * * Split out of `build.ts` when that file hit its line ceiling, and because the * rule below deserves a place to be explained rather than a comment squeezed * between two loops. * * A group does not redraw anything. It REARRANGES whole columns between rows, * so every column keeps its multiset and every declared percentage stays * exactly what it was. That is what decides who may join a group: * * - a plain `` may — its value is bound to nothing in its row; * - a `` may — the multiset is preserved, so the shares survive; * - a `` may ONLY MOVE BETWEEN ROWS WITH THE SAME SUBJECT — its value * answers the subject of its own row, and a free swap would put a male name * in a female row; * - a `` may not, and never joins: it is a function of other columns * in the same row (TDC218); * - a compound may not: it owns a field per gen, not one column (TDC129). */ import type { SequenceBuildContext } from './context.js'; import { type Sequence, type SequenceSpec } from './types.js'; /** A sequence yields a single value per row (not a compound of fields). */ export declare function isScalarSpec(spec: SequenceSpec): boolean; /** * Spread one member's values across the blocks before anything is arranged * inside them. * * A `text` list is laid out in exact shares over the WHOLE column, and then a * `` cuts the rows into blocks — so a block gets whichever values * happened to fall there, not a fair share of them. Measured on a group of four * over 29 rows: the male block came out `[7,3,4]` and `[6,5,3]` where an even * deal is `[5,5,4]` and `[5,5,4]`, and that difference is the difference * between 13 achievable tuples and 14. The run was refused for want of data it * had. * * Each value is split over the blocks in proportion to their sizes, largest * remainder first, clamped to the room a block has left. The MULTISET is * untouched — the same values in the same numbers, only distributed — so every * declared percentage survives exactly, which is the rule the whole group obeys. * * What this can and cannot recover is worth stating. It undoes the imbalance * the CUT introduced. It does nothing for imbalance that was in the draw to * begin with: a `template` column draws each row independently, so its counts * are uneven before any block exists, and dealing an already-random column * across two blocks leaves it just as random. */ /** * One column dealt across the blocks a `` cut the group into. * * Exported for its own tests: the arrangement IS the output, so the rule deserves to be pinned * directly rather than only through the shapes that happen to exercise it. */ export declare function dealAcrossBlocks(column: readonly string[], blockSizes: readonly number[]): string[][]; /** * Enforce config-level `` groups. Each group names scalar sequences whose * combined tuple must be unique across all rows. Over the rows where every * member is defined, rearrange the columns jointly so tuples are distinct; * refuse before any output if the data cannot supply that many combinations. */ export declare function enforceEnvUniq(groups: readonly (readonly string[])[], specs: readonly SequenceSpec[], registry: Record, count: number): void; /** * Enforce config-level `` groups. Each group names scalar * sequences whose values must differ from each other within one row. For * each group and applicable row, walk the group's sequences in declaration * order; a value that collides with an already-accepted one is redrawn * (one fresh scalar from that sequence's own gen/switch, on a stream named * for the sequence and the attempt — the same one the streaming engine uses) * until it differs. Rows where a sequence produced `undefined` (filtered * out by a parent) are skipped for that sequence. * * Only scalar sequences (simple `` or ``) participate; * compound sequences have no single value and are excluded (the validator * rejects them in a group). Deterministic and fuse-bounded like the * field-level repair (see enforceDistinct). */ export declare function enforceEnvDistinct(groups: readonly (readonly string[])[], specs: readonly SequenceSpec[], registry: Record, count: number, prng: () => number, locale: string, now: number, ctx: SequenceBuildContext): void; //# sourceMappingURL=env-groups.d.ts.map