/**
 * Format Preservation Validator
 *
 * Validates sync operations to ensure external items maintain their original format.
 * Prevents unintended modifications to external item titles, descriptions, and ACs.
 *
 * Key validations:
 * - External items (format_preservation=true) → only comments allowed
 * - Internal items (format_preservation=false) → full sync allowed
 * - Title immutability for external items
 * - Description immutability for external items
 * - AC modifications blocked for external items
 *
 * Part of increment 0047-us-task-linkage (T-034C)
 */
import type { Logger } from '../utils/logger.js';
/**
 * Sync operation to validate
 */
export interface SyncOperation {
    /** User Story ID (e.g., "US-009") */
    usId: string;
    /** Format preservation enabled flag */
    formatPreservation: boolean;
    /** Fields to update (e.g., ['title', 'description', 'comments']) */
    updates: string[];
    /** Origin (internal | external) */
    origin?: 'internal' | 'external';
    /** Proposed title change (if any) */
    proposedTitle?: string;
    /** Current title (for validation) */
    currentTitle?: string;
}
/**
 * Validation result
 */
export interface ValidationResult {
    /** Validation passed flag */
    valid: boolean;
    /** Validation errors */
    errors?: string[];
    /** Validation warnings (non-blocking) */
    warnings?: string[];
    /** Allowed fields (after filtering blocked fields) */
    allowedFields?: string[];
    /** Blocked fields */
    blockedFields?: string[];
}
/**
 * Format Preservation Validator
 *
 * Ensures external items maintain their original format during sync operations.
 */
export declare class FormatPreservationValidator {
    private logger;
    constructor(options?: {
        logger?: Logger;
    });
    /**
     * Validate sync operation
     *
     * Checks if the proposed sync operation violates format preservation rules.
     *
     * Rules:
     * 1. External items (format_preservation=true) → ONLY comments allowed
     * 2. Title updates → BLOCKED for external items
     * 3. Description updates → BLOCKED for external items
     * 4. AC updates → BLOCKED for external items
     * 5. Status updates → ALLOWED (external tools control lifecycle)
     * 6. Comments → ALWAYS ALLOWED
     *
     * @param operation - Sync operation to validate
     * @returns Validation result
     */
    validate(operation: SyncOperation): ValidationResult;
    private static readonly BLOCKED_FIELDS;
    /**
     * Check if field is blocked for external items
     */
    private isBlockedField;
    /**
     * Get error message for blocked field
     */
    private getBlockedFieldError;
    /**
     * Validate batch sync operations
     *
     * Validates multiple sync operations and returns results for each.
     *
     * @param operations - Array of sync operations
     * @returns Array of validation results
     */
    validateBatch(operations: SyncOperation[]): ValidationResult[];
    /**
     * Quick check: Is sync allowed?
     *
     * Simplified validation that returns true/false without detailed errors.
     *
     * @param formatPreservation - Format preservation flag
     * @param proposedUpdates - Fields to update
     * @returns True if sync is allowed
     */
    isSyncAllowed(formatPreservation: boolean, proposedUpdates: string[]): boolean;
    /**
     * Filter allowed fields from sync operation
     *
     * Returns only the fields that are allowed for the given operation.
     *
     * @param operation - Sync operation
     * @returns Array of allowed field names
     */
    filterAllowedFields(operation: SyncOperation): string[];
    /**
     * Get validation summary for logging
     *
     * @param result - Validation result
     * @returns Human-readable summary
     */
    getValidationSummary(result: ValidationResult): string;
}
//# sourceMappingURL=format-preservation-validator.d.ts.map