import { type CompilationUnit } from "../compilationUnit.js"; import type { TypeAliasEntry, VariableType } from "../types.js"; export type ShapeResult = { ok: true; } | { ok: false; reason: string; }; /** * A minimal CompilationUnit carrying only the alias registry, for * typechecking probe programs. CompilationUnit is a plain data type (no * closures — unlike TypeCheckerContext), so this construction is stable. */ export declare function makeProbeUnit(typeAliases: Record): CompilationUnit; /** * Does `valueText` fit the type written as `declaredType`? Decided by the * language's own typechecker on a one-line probe program — parsed and * typechecked in memory, never executed. Any diagnostic (assignability, * unknown property, undefined variable inside an interpolation, parse * failure) is a rejection; the first message is the retry feedback for the * mutator LLM. * * Known fail-open, inherited from the language: an object literal containing * an explicit `null` field synthesizes to `any`, which skips the assignment * check entirely — such proposals are accepted unchecked. Fail-open is the * right direction (a valid value is never wrongly rejected). */ export declare function checkProposal(declaredType: string, valueText: string, typeAliases: Record): ShapeResult; /** * Render an annotation back to parseable source text for probing and for the * mutator prompt. The baseline self-test in discovery validates the * round-trip: a rendered type that does not re-parse, or does not accept the * target's own original value, leaves the target unconstrained. */ export declare function renderDeclaredType(typeHint: VariableType): string; /** * One-line description of a target's allowed values for the mutator prompt. * `declaredType === null` means freeform for text targets and * unconstrained for literal targets — see the valueKind-first invariant in * `OptimizeTarget`. */ export declare function describeConstraint(target: { declaredType: string | null; valueKind: string; }): string;