import type { ObservationRecord } from './format.js'; /** * Whether a promotion would land, decided before anything is promoted. * * `accept` used to be the only thing that knew these rules, and it knew them by * running: the answer to *what would this update record* was the update. That is * fine for a person at a terminal and useless to anything asking beforehand — an * agent proposing a command, a reader previewing a commit message — because the * only way to find out was to do it. * * So the rules are a function over one observation and the command applies them * rather than owning them. What that buys is the property the whole changelog * argument rests on: a preview and the acceptance it previews cannot disagree, * because there is one set of rules and both read it. A second copy that drifted * would produce the worst available artifact here — a confident account of a * baseline update that did not happen. * * Every refusal is the sentence `accept` prints, unchanged. The wording is part * of the rule: it names what to do next, and an agent that gets a different * sentence from the preview than from the command has to decide which one is the * product. */ /** * What would happen to this subject, and why. * * Three outcomes rather than a boolean, because *already the baseline* is not a * refusal and printing it as one turns the ordinary case — the two hundred and * ninety-eight subjects a run did not change — into a wall of failures. It is * also not a promotion: nothing is written, and a record that counted it would * describe a baseline update nobody made. */ export type Promotion = { readonly kind: 'promotable'; /** * The candidate that would become the baseline, as the report named it: * the `after` image, or the sidecar alone for a subject with no pixels. * * Carried on the answer rather than looked up again by the caller. A * command that re-read `images.after` after being told a subject is * promotable would be asking a second time whether the run left an image, * and two readings of one fact are two answers waiting to differ. */ readonly from: string; } | { readonly kind: 'already-baseline'; readonly because: string; } | { readonly kind: 'refused'; readonly because: string; }; /** * The rules, in the order they are asked. * * The order is load-bearing in one place: instability is asked *before* the * verdict. A subject that read two ways and settled on `unchanged` is not a * subject that did not change — `--flakes` reached the same baseline twice and * got two answers — and answering "already the baseline" there hides the * diagnostic that makes this refusable at all. */ export declare function promotionOf(observation: ObservationRecord): Promotion; /** * Subjects a set of shapes can and cannot settle. * * `whole` is the safe bulk: every difference this subject has carries one of the * named shapes, so promoting the shape here promotes nothing else. `partial` is * the refusal that makes the bulk safe — the shape is present, something the * shape does not name also moved, and accepting it there would baseline a * difference nobody reviewed. * * A subject with no region at all is in neither list. It is not evidence about * these shapes in either direction. * * Generic over the record, because this only ever *filters*: every object it * returns is one it was handed. A caller reading a richer record — the CLI's, * which carries diagnostics and placement — would otherwise get the base type * back and have to assert its own rows back into their own shape. */ export declare function selectByShape(observations: readonly T[], shapes: ReadonlySet): { whole: readonly T[]; partial: readonly T[]; }; /** * Why a shape present in this subject cannot settle it. * * Two different facts wearing one outcome, and they send a reader to different * places: the run recorded another difference, or the run stopped recording. The * second is not evidence that something else moved — it is the absence of * evidence that nothing did, which is why it refuses in exactly the same way. */ export declare function whyNotWhole(observation: ObservationRecord): string; //# sourceMappingURL=promotion.d.ts.map