/** * LexSona Behavioral Rules Schemas * * Zod schemas for behavioral rules with confidence scoring. * Part of LexSona v0 Integration (0.5.0 Tier 4). * * @see docs/LEXSONA.md for architecture overview * @see docs/research/LexSona/MATH_FRAMEWORK_v0.1.md for mathematical framework */ import { z } from "zod"; /** * BehaviorRule schema - validation for rule records stored in lexsona_behavior_rules table * * Stores behavioral patterns learned from user corrections with Bayesian confidence scoring. * Based on the LexSona mathematical framework's Beta-Bernoulli confidence estimation. */ export declare const BehaviorRuleSchema: z.ZodObject<{ rule_id: z.ZodString; context: z.ZodRecord; correction: z.ZodString; confidence_alpha: z.ZodNumber; confidence_beta: z.ZodNumber; observation_count: z.ZodNumber; created_at: z.ZodString; updated_at: z.ZodString; last_observed: z.ZodString; decay_tau: z.ZodDefault; }, z.core.$strip>; export type BehaviorRule = z.infer; /** * CorrectionSchema - validation for user feedback/corrections * * Used when ingesting new corrections from users. The system will match * corrections to existing rules or create new ones. */ export declare const CorrectionSchema: z.ZodObject<{ context: z.ZodRecord; correction: z.ZodString; user_id: z.ZodOptional; timestamp: z.ZodString; }, z.core.$strip>; export type Correction = z.infer; /** * Parse and validate a BehaviorRule object * @param data - The data to parse * @returns Validated BehaviorRule object * @throws ZodError if validation fails */ export declare function parseBehaviorRule(data: unknown): BehaviorRule; /** * Validate a BehaviorRule object without throwing * @param data - The data to validate * @returns Validation result with success flag and optional data/error */ export declare function validateBehaviorRule(data: unknown): { success: true; data: BehaviorRule; } | { success: false; error: z.ZodError; }; /** * Parse and validate a Correction object * @param data - The data to parse * @returns Validated Correction object * @throws ZodError if validation fails */ export declare function parseCorrection(data: unknown): Correction; /** * Validate a Correction object without throwing * @param data - The data to validate * @returns Validation result with success flag and optional data/error */ export declare function validateCorrection(data: unknown): { success: true; data: Correction; } | { success: false; error: z.ZodError; };