/** * Auto-verification: run a candidate recipe K times under a clean * setup, decide promote / keep-candidate / demote based on the * success ratio. * * The caller provides a `setupPage` factory — typically wrapping * `browser.newContext().newPage()` plus `goto(startUrl)` — because * verification semantics differ across consumers. A crawler verifier * wants a fresh context every run; a Playwright Test verifier wants * to reuse a logged-in storage state. We don't impose either. * * Stats are recorded back into the store after every run, regardless * of the eventual promotion outcome. */ import type { Page } from "playwright"; import type { RecipeStore } from "./store.js"; import type { ActionRecipe } from "./types.js"; export interface VerifyOptions { /** How many times to re-run before deciding. */ runs?: number; /** Promote if success / runs >= this. */ minSuccessRate?: number; /** Demote (mark "demoted") if success / runs < this. */ demoteBelow?: number; /** * Factory that produces a Page ready to start the recipe at its * starting URL. The factory's return tuple also gives a `cleanup` * hook so the verifier can dispose contexts deterministically. */ setupPage: () => Promise<{ page: Page; cleanup: () => Promise; }>; /** Logger for visibility — defaults to `console.log` if `verbose`, else silent. */ verbose?: boolean; } export interface VerifyResult { promoted: boolean; demoted: boolean; successRate: number; runs: number; /** Per-run outcomes for debugging. */ outcomes: Array<{ ok: boolean; durationMs: number; reason?: string; }>; } export declare function verifyAndPromote(store: RecipeStore, recipe: ActionRecipe, opts: VerifyOptions): Promise; //# sourceMappingURL=verify.d.ts.map