/**
 * @deprecated [DC-3] 无运行时消费方。保留供未来工作区隔离实现。
 *
 * 工作区隔离 — 问题二十八 (Workspace Isolation / Concurrency Contract)。
 *
 * 核心规则:
 * - 同 scope code_write 冲突必须 blocked 或 require_human
 * - delivery 必须互斥
 * - lease active/conflicted 不得交付
 * - out-of-scope write 必须 blocked
 */
import { type DiagnosticEvent } from "../audit/diagnostic_registry.js";
export type LeaseType = "code_write" | "delivery" | "output_artifact";
export type LeaseStatus = "active" | "released" | "expired" | "conflicted";
export interface WorkspaceLease {
    lease_id: string;
    task_id: string;
    lease_type: LeaseType;
    scope_paths: string[];
    status: LeaseStatus;
    acquired_at: string;
    expires_at?: string;
    diagnostic_event: DiagnosticEvent | null;
}
export interface WorkspaceIsolationReport {
    report_id: string;
    task_id: string;
    active_leases: WorkspaceLease[];
    conflicts: LeaseConflict[];
    out_of_scope_writes: Array<{
        path: string;
        allowed_paths: string[];
    }>;
    delivery_blocked: boolean;
    evaluated_at: string;
}
export interface LeaseConflict {
    lease_a_id: string;
    lease_b_id: string;
    conflict_path: string;
    conflict_type: "scope_overlap" | "delivery_overlap";
    resolved: boolean;
}
/**
 * 清理状态为 released 且超过 1 小时的过期条目。
 * 在 acquireLease 时调用，保持存储清洁。
 * @returns 清理的条目数量
 */
export declare function purgeExpiredLeases(): number;
/** 获取 lease */
export declare function getLease(leaseId: string): WorkspaceLease | undefined;
/** 列出所有活跃 lease */
export declare function listActiveLeases(): WorkspaceLease[];
/**
 * 尝试获取 lease。
 * 如果同 scope 有冲突，返回冲突信息。
 */
export declare function acquireLease(taskId: string, leaseType: LeaseType, scopePaths: string[]): {
    lease: WorkspaceLease | null;
    conflicts: LeaseConflict[];
    purged: number;
};
/** 释放 lease */
export declare function releaseLease(leaseId: string): boolean;
/**
 * 检查是否超出 scope 写入。
 */
export declare function checkOutOfScopeWrite(_taskId: string, targetPath: string, allowedPaths: string[]): {
    allowed: boolean;
    reason?: string;
};
/**
 * 生成工作区隔离报告。
 */
export declare function generateIsolationReport(taskId: string): WorkspaceIsolationReport;
/** 重置 lease 存储（测试用） */
export declare function resetLeaseStore(): void;
//# sourceMappingURL=workspace_lease.d.ts.map