/**
 * 降级契约 — 问题十八 (Degradation Contract)。
 *
 * 核心规则:
 * - DegradationEvent 必须用户可见
 * - degraded 不得标记 completed
 * - 恢复 full mode 必须经过 RecoveryGate
 * - safety/enforcement 类组件不可降级为允许写入
 */
import { type DiagnosticEvent } from "./diagnostic_registry.js";
export type DegradedComponent = "verifier" | "reviewer" | "knowledge_injector" | "scope_controller" | "audit_logger" | "enforcement_guard";
export interface DegradationEvent {
    event_id: string;
    task_id: string;
    component: DegradedComponent;
    previous_mode: "full" | "degraded" | "unavailable";
    current_mode: "full" | "degraded" | "unavailable";
    reason: string;
    user_visible_message: string;
    missing_capabilities: string[];
    risk_description: string;
    next_action: string;
    diagnostic_event: DiagnosticEvent | null;
    occurred_at: string;
}
export interface RecoveryGate {
    gate_id: string;
    task_id: string;
    component: DegradedComponent;
    checks: Array<{
        check_id: string;
        description: string;
        passed: boolean;
    }>;
    all_passed: boolean;
    evaluated_at: string;
}
/**
 * 创建降级事件。
 */
export declare function createDegradationEvent(taskId: string, component: DegradedComponent, previousMode: "full" | "degraded" | "unavailable", reason: string, missingCapabilities: string[]): DegradationEvent | null;
/**
 * 评估恢复门。
 * 从降级恢复到 full mode 必须通过所有检查。
 */
export declare function evaluateRecoveryGate(taskId: string, component: DegradedComponent, checks: Array<{
    check_id: string;
    description: string;
    passed: boolean;
}>): RecoveryGate;
/**
 * 验证降级规则。
 */
export declare function validateDegradation(event: DegradationEvent): Array<{
    error: string;
    severity: "hard_fail" | "warning";
}>;
//# sourceMappingURL=degradation.d.ts.map