/**
 * Protocol Enforcement for CLEO
 *
 * Validates RCASD-IVTR+C lifecycle compliance with exit codes 60-70.
 * Intercepts domain operations to enforce protocol requirements before execution.
 *
 * Moved from src/mcp/lib/protocol-enforcement.ts to core for proper layering.
 *
 * @task T2918
 * @task T5707
 * @epic T2908
 */
import { type ProtocolValidationResult, type ProtocolViolation } from './protocol-rules.js';
import { type ProtocolRequest, type ProtocolResponse } from './protocol-types.js';
/**
 * Protocol types aligned with RCASD-IVTR+C lifecycle
 */
export declare enum ProtocolType {
    RESEARCH = "research",
    CONSENSUS = "consensus",
    SPECIFICATION = "specification",
    DECOMPOSITION = "decomposition",
    IMPLEMENTATION = "implementation",
    CONTRIBUTION = "contribution",
    RELEASE = "release",
    VALIDATION = "validation",
    TESTING = "testing"
}
/**
 * Violation log entry
 */
export interface ViolationLogEntry {
    timestamp: string;
    taskId?: string;
    protocol: ProtocolType;
    violations: ProtocolViolation[];
    score: number;
    blocked: boolean;
}
/**
 * Main protocol enforcement class
 */
export declare class ProtocolEnforcer {
    private violations;
    private strictMode;
    constructor(strictMode?: boolean);
    /**
     * Validate protocol compliance for a manifest entry
     */
    validateProtocol(protocol: ProtocolType, manifestEntry: Record<string, unknown>, additionalData?: Record<string, unknown>): Promise<ProtocolValidationResult>;
    /**
     * Validate a single rule
     */
    private validateRule;
    /**
     * Check lifecycle gate prerequisites
     */
    checkLifecycleGate(_taskId: string, targetStage: string, lifecycleManifest?: Record<string, unknown>): Promise<{
        passed: boolean;
        missingPrerequisites: string[];
        message: string;
    }>;
    /**
     * Record a protocol violation
     */
    recordViolation(protocol: ProtocolType, violations: ProtocolViolation[], score: number, taskId?: string): void;
    /**
     * Get recent violations
     */
    getViolations(limit?: number): ViolationLogEntry[];
    /**
     * Calculate penalty for violation severity
     */
    private calculatePenalty;
    /**
     * Middleware function for domain router
     *
     * Intercepts operations and validates protocol compliance before execution.
     */
    enforceProtocol(request: ProtocolRequest, next: () => Promise<ProtocolResponse>): Promise<ProtocolResponse>;
    /**
     * Determine if operation requires protocol validation
     */
    private requiresProtocolValidation;
    /**
     * Detect protocol type from request/response
     */
    private detectProtocol;
    /**
     * Extract manifest entry from response
     */
    private extractManifestEntry;
    /**
     * Set strict mode
     */
    setStrictMode(strict: boolean): void;
    /**
     * Get strict mode status
     */
    isStrictMode(): boolean;
}
/**
 * Default protocol enforcer instance
 */
export declare const protocolEnforcer: ProtocolEnforcer;
//# sourceMappingURL=protocol-enforcement.d.ts.map