import { type ProjectDiagnostic } from "./program-diagnostics.ts"; import { type ConversionUnit, type GeneratedConversionUnit, type ProjectMemoryProvider } from "../../workflows/types.ts"; export interface StagedRepairRequest { unit: ConversionUnit; /** Project-relative path of the candidate being repaired. */ targetPath: string; /** The unit's current generated code (whole file contents). */ currentCode: string; /** Normalized new diagnostics attributed to this candidate's dependency group. */ diagnostics: ProjectDiagnostic[]; /** Trusted deterministic guidance for recognized compiler diagnostics. */ hints: string[]; /** Other generated candidate files in the same dependency group. */ relatedFiles: Array<{ path: string; content: string; }>; /** Target-specific current/projected repository evidence within the same budget. */ projectMemory?: string; } export type StagedValidationProgress = { kind: "project-validate"; files: number; pass: number; } | { kind: "repair"; unit: ConversionUnit; attempt: number; } | { kind: "reject"; unit: ConversionUnit; reason: string; }; export interface StagedValidationOptions { /** Bounded cross-file repair callback; omitted means failing groups are rejected directly. */ repair?: (request: StagedRepairRequest) => Promise; /** Repair requests allowed per whole-file unit (default 1). */ maxRepairAttemptsPerUnit?: number; /** Character budget for one repair request's code-and-diagnostics context. */ contextCharBudget?: number; /** Shared project memory, refreshed when a repair changes a candidate. */ projectMemory?: ProjectMemoryProvider; /** Existing whole-file targets proven to be owned by a compiler lock entry. */ allowExistingTargets?: ReadonlySet; /** Permit target-scoped repairs for multi-marker inline files. Compiler mode enables this. */ repairInlineUnits?: boolean; onProgress?: (event: StagedValidationProgress) => void; } export interface StagedValidationOutcome { /** One result per input unit, in input order; rejected units carry `error`. */ results: GeneratedConversionUnit[]; /** True when a combined candidate program was actually type-checked. */ validated: boolean; /** Number of bounded repair requests issued. */ repairRequests: number; } /** * Validate the combined candidate project before anything is written and * return per-unit accept/reject results. Python receives combined syntax * validation; other units that do not produce JS/TS keep their per-unit level. */ export declare function validateCandidateProject(root: string, generated: readonly GeneratedConversionUnit[], options?: StagedValidationOptions): Promise; //# sourceMappingURL=staged-validation.d.ts.map