/**
 * Core validation engine - ported from lib/validation/validation.sh
 *
 * Provides schema validation, task field validation, status transitions,
 * timestamp sanity checks, ID uniqueness, phase validation, circular
 * dependency detection, and comprehensive file validation.
 *
 * @task T4523
 * @epic T4454
 */
import { type TaskStatus } from '@cleocode/contracts';
export type { TaskStatus } from '@cleocode/contracts';
export declare const VALID_OPERATIONS: readonly ["create", "update", "complete", "archive", "restore", "delete", "validate", "backup"];
/** Field length limits matching the Bash implementation. */
export declare const FIELD_LIMITS: {
    readonly MAX_TITLE_LENGTH: 120;
    readonly MAX_DESCRIPTION_LENGTH: 2000;
    readonly MAX_NOTE_LENGTH: 5000;
    readonly MAX_BLOCKED_BY_LENGTH: 300;
    readonly MAX_SESSION_NOTE_LENGTH: 2500;
    readonly MIN_CANCEL_REASON_LENGTH: 5;
    readonly MAX_CANCEL_REASON_LENGTH: 300;
};
/** Validation result exit codes. */
export declare const VAL_SUCCESS = 0;
export declare const VAL_SCHEMA_ERROR = 1;
export declare const VAL_SEMANTIC_ERROR = 2;
export declare const VAL_BOTH_ERRORS = 3;
export interface ValidationError {
    field?: string;
    message: string;
    severity: 'error' | 'warning';
    fix?: string;
}
export interface ValidationResult {
    valid: boolean;
    errors: ValidationError[];
    warnings: ValidationError[];
}
/**
 * Sanitize a file path for safe shell usage.
 * Prevents command injection via malicious file names.
 * @task T4523
 */
export declare function sanitizeFilePath(path: string): string;
/**
 * Validate a task title.
 * Checks for emptiness, newlines, invisible characters, control chars, and length.
 * @task T4523
 */
export declare function validateTitle(title: string): ValidationResult;
/** @task T4523 */
export declare function validateDescription(desc: string): ValidationResult;
/** @task T4523 */
export declare function validateNote(note: string): ValidationResult;
/** @task T4523 */
export declare function validateBlockedBy(reason: string): ValidationResult;
/** @task T4523 */
export declare function validateSessionNote(note: string): ValidationResult;
/**
 * Validate a cancellation reason.
 * @task T4523
 */
export declare function validateCancelReason(reason: string): ValidationResult;
/**
 * Validate that a status transition is allowed.
 * @task T4523
 */
export declare function validateStatusTransition(oldStatus: TaskStatus, newStatus: TaskStatus): ValidationResult;
/**
 * Check if a status string is valid.
 * @task T4523
 */
export declare function isValidStatus(status: string): status is TaskStatus;
/**
 * Check timestamp format and sanity.
 * @task T4523
 */
export declare function checkTimestampSanity(createdAt: string, completedAt?: string): ValidationResult;
/**
 * Check if an update contains only metadata fields (safe for done tasks).
 * @task T4523
 */
export declare function isMetadataOnlyUpdate(fields: string[]): boolean;
/**
 * Deduplicate and normalize labels.
 * @task T4523
 */
export declare function normalizeLabels(labels: string): string;
export interface Task {
    id?: string;
    content?: string;
    title?: string;
    status?: string;
    activeForm?: string;
    created_at?: string;
    completed_at?: string;
    parentId?: string | null;
    type?: string;
    depends?: string[];
    cancelledAt?: string;
    cancellationReason?: string;
    [key: string]: unknown;
}
/** Task data shape for validation functions. */
export interface TaskData {
    tasks: Task[];
    project?: {
        currentPhase?: string;
        phases?: Record<string, {
            status?: string;
            startedAt?: string;
            completedAt?: string;
        }>;
    };
}
/** Archive data shape for validation functions. */
export interface ArchiveData {
    archived_tasks: Task[];
}
/**
 * Check ID uniqueness within and across files.
 * @task T4523
 */
export declare function checkIdUniqueness(taskFile: TaskData, archiveFile?: ArchiveData): ValidationResult;
/**
 * Validate a single task object.
 * @task T4523
 */
export declare function validateTask(task: Task): ValidationResult;
/**
 * Check for circular dependencies using DFS.
 * @task T4523
 */
export declare function validateNoCircularDeps(tasks: Task[], taskId: string, newDeps: string[]): ValidationResult;
/**
 * Validate only one phase is active.
 * @task T4523
 */
export declare function validateSingleActivePhase(taskFile: TaskData): ValidationResult;
/**
 * Validate currentPhase matches an active phase.
 * @task T4523
 */
export declare function validateCurrentPhaseConsistency(taskFile: TaskData): ValidationResult;
/**
 * Validate phase timestamp ordering.
 * @task T4523
 */
export declare function validatePhaseTimestamps(taskFile: TaskData): ValidationResult;
/**
 * Validate phase status requirements (e.g., active phases must have startedAt).
 * @task T4523
 */
export declare function validatePhaseStatusRequirements(taskFile: TaskData): ValidationResult;
export interface ComprehensiveValidationResult {
    schemaErrors: number;
    semanticErrors: number;
    exitCode: number;
    checks: Array<{
        name: string;
        passed: boolean;
        message: string;
    }>;
}
/**
 * Run all validation checks on a TaskFile.
 * @task T4523
 */
export declare function validateAll(taskFile: TaskData, archiveFile?: ArchiveData): ComprehensiveValidationResult;
//# sourceMappingURL=engine.d.ts.map