import type { FixProposal, OwnershipModel, SchemaSnapshot, Violation } from "../types.js"; /** * Write the policy that closes the hole. * * Detection on its own just manufactures anxiety: the person shipping these * apps usually cannot write the policy themselves, which is how the problem got * there. So the fix matters more than the finding — but only if it is safe, and * an over-restrictive policy that locks out legitimate users is its own outage. * Two things guard against that: nothing is emitted without being applied and * re-tested first (see verify/), and every judgement call the generator makes on * the developer's behalf is stated out loud as a caveat rather than buried. */ export interface FixContext { snapshot: SchemaSnapshot; model: OwnershipModel; helper: string; } export declare function generateFixes(snapshot: SchemaSnapshot, model: OwnershipModel, violations: Violation[]): FixProposal[]; /** * A policy on the membership table that queries the membership table recurses * forever. Routing the lookup through a security-definer function is the * standard fix, and every org-scoped policy we emit uses it. */ export declare function helperSql(ctx: FixContext): string;