/** * Receipt Validation Helper * * Provides validation for Receipt payloads with structured error reporting. * * @module memory/receipts/validator */ /** * Validation error with field path information */ export interface ReceiptValidationError { /** Dot-notation path to the field (e.g., "uncertaintyNotes[0].stated") */ path: string; /** Human-readable error message */ message: string; /** Error code for programmatic handling */ code: string; } /** * Warning about unknown fields */ export interface ReceiptValidationWarning { /** Dot-notation path to the unknown field */ path: string; /** Warning message */ message: string; } /** * Result of Receipt payload validation */ export interface ReceiptValidationResult { /** Whether the payload is valid */ valid: boolean; /** Array of validation errors (empty if valid) */ errors: ReceiptValidationError[]; /** Array of warnings for unknown fields */ warnings: ReceiptValidationWarning[]; } /** * Validate a Receipt payload * * This function validates Receipt data against the schema and returns * structured errors with field paths and warnings for unknown fields. * * @param data - The payload to validate (unknown type for maximum flexibility) * @returns ReceiptValidationResult with valid flag, errors, and warnings * * @example * ```typescript * import { validateReceiptPayload } from '@smartergpt/lex/memory/receipts'; * * const payload = { * schemaVersion: '1.0.0', * kind: 'Receipt', * action: 'Implemented feature X', * outcome: 'success', * rationale: 'User requirement', * confidence: 'high', * reversibility: 'reversible', * escalationRequired: false, * timestamp: '2025-12-05T02:00:00Z' * }; * * const result = validateReceiptPayload(payload); * if (result.valid) { * // Safe to use * console.log('Valid receipt!'); * } else { * console.error('Validation errors:', result.errors); * } * ``` */ export declare function validateReceiptPayload(data: unknown): ReceiptValidationResult; /** * Validate an UncertaintyMarker payload * * @param data - The payload to validate * @returns ReceiptValidationResult with valid flag, errors, and warnings */ export declare function validateUncertaintyMarkerPayload(data: unknown): ReceiptValidationResult;