/** Stable id of an auto-row rule. */ export type AutoRowRuleId = 'dispatch-trace' | 'doc-attachment' | 'task-stub'; /** One named auto-row rule with its exact SQL predicate. */ export interface AutoRowRule { /** Stable id, reported in counts. */ readonly id: AutoRowRuleId; /** Table the rule reads. */ readonly table: 'patterns' | 'observations'; /** SQL predicate over unaliased columns, ANDed with the current/unverified guard. */ readonly predicate: string; } /** Guard every rule shares: only current, unverified rows. */ export declare const CURRENT_UNVERIFIED = "invalid_at IS NULL AND COALESCE(verified, 0) != 1"; /** The rules, each matching rows only machinery writes. */ export declare const AUTO_ROW_RULES: readonly AutoRowRule[]; /** * The SQL guard for a write: any of the named rules, on current unverified rows. * * @param table - Table being written. * @param ruleIds - Rules the row must still match. * @returns A predicate over unaliased columns. * @throws Error when no rule is named, or a rule is unknown or reads another table. * @example * ```ts * const guard = autoRowGuard('patterns', ['dispatch-trace']); * ``` */ export declare function autoRowGuard(table: 'patterns' | 'observations', ruleIds: readonly AutoRowRuleId[]): string; //# sourceMappingURL=auto-row-rules.d.ts.map