/** * Pre-migration JSON validation. * * Validates all JSON source files BEFORE any destructive database operations. * This prevents data loss scenarios where the database is deleted but JSON parsing fails. * * @task T4725 * @epic T4454 */ /** Result of validating a single JSON file. */ export interface JsonFileValidation { valid: boolean; exists: boolean; count: number; error?: string; line?: number; column?: number; } /** Complete validation result for all source files. */ export interface JsonValidationResult { valid: boolean; todoJson: JsonFileValidation; sessionsJson: JsonFileValidation; archiveJson: JsonFileValidation; totalTasks: number; warnings: string[]; } /** * Validate all JSON source files before migration. * * This function MUST be called BEFORE any destructive database operations. * It checks that all JSON files are parseable and contain expected data. * * @param cleoDir - Path to the .cleo directory * @returns Validation result with details for each file * @task T4725 */ export declare function validateSourceFiles(cleoDir: string): JsonValidationResult; /** * Format validation result for human-readable output. * * @param result - Validation result * @returns Formatted string */ export declare function formatValidationResult(result: JsonValidationResult): string; /** * Check for task count mismatch between existing database and JSON. * * This helps detect cases where the database has data but JSON is empty * (indicating a potential configuration or path issue). * * @param cleoDir - Path to .cleo directory * @param jsonTaskCount - Number of tasks found in JSON * @returns Warning message if mismatch detected, null otherwise */ export declare function checkTaskCountMismatch(cleoDir: string, jsonTaskCount: number): string | null; //# sourceMappingURL=validate.d.ts.map