/** * 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 to core for proper layering (formerly in dispatch). * * @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, additionalData?: Record): Promise; /** * Validate a single rule */ private validateRule; /** * Check lifecycle gate prerequisites */ checkLifecycleGate(_taskId: string, targetStage: string, lifecycleManifest?: Record): 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): Promise; /** * 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