/** * design #8 — the post-green fidelity phase. After brew's behavioural/structural * tests pass, render the brewed app vs the mock across the spec-declared modes * and either (a) gate: drift → escalate to the #9 designer/QA gate, or (b) drive: * feed the hard per-element violations back to the brew agent over a hot-reload * candidate, bounded, until convergence or escalation. * * The eye measurement + the brew-fix application are INJECTED — the orchestration * (matrix from spec, loop, escalation mapping) is pure-flow + unit-tested; the * Playwright render (../eye/run.ts) and the live brew-agent fix supply the seams. */ import type { FidelityViolation } from "@slowcook-ai/gates"; import { type EyeContext } from "../eye/plan.js"; /** * Render violations into a concise, mock-faithful fix instruction for the brew * agent. Grouped by viewport/scheme; scoped to presentation-only edits. Pure. */ export declare function formatViolationsForBrew(violations: FidelityViolation[]): string; export interface FidelityPhaseDeps { /** Story id — used to resolve the spec's fidelity.modes. */ story?: string; /** Repo root for the spec lookup. */ cwd: string; /** Render + grade the matrix → violations (real: a runEyeMatrix wrapper). */ measure: (matrix: EyeContext[]) => Promise; /** * Apply fixes via the brew agent against a hot-reload candidate, then the * caller's HMR re-renders. OMIT for gate-only mode (drift → escalate, no fix). */ applyFix?: (violations: FidelityViolation[], iteration: number) => Promise; maxIters?: number; log?: (msg: string) => void; } export interface FidelityPhaseResult { converged: boolean; escalated: boolean; iterations: number; remaining: FidelityViolation[]; reason: string; /** The #9 gate action: pass advances; blocked-on-designer halts for review. */ gateAction: "pass" | "blocked-on-designer"; matrixCells: number; } /** * Run the fidelity phase. Matrix comes from the spec's fidelity.modes (the * contract) or the full default. Gate-only when `applyFix` is omitted. */ export declare function runFidelityPhase(deps: FidelityPhaseDeps): Promise; //# sourceMappingURL=fidelity-phase.d.ts.map