/**
 * 统一契约注册表 — 运行时注册表、查询、动态注册
 *
 * 问题二十 (Unified Contract Registry) 核心实现:
 * - 统一登记 workflow、guard、verification、delivery、failure、degradation、
 *   metric、language_policy 等所有核心契约
 * - contract_id 作为一等治理身份
 * - policy_id 到 contract_id 的映射
 * - Runtime hard fail gating
 *
 * Capability Registry 保留为能力状态事实源，此表覆盖更广泛的契约类型。
 */
import type { ContractKind, ContractState, ContractRegistryEntry, ContractRegistrySummary } from "./types.js";
export type { ContractKind, ContractState, ContractRegistryEntry, ContractGovernanceFinding, ContractRegistrySummary, } from "./types.js";
export { validateContractRegistry, validateWorkflowContractRefs } from "./validation.js";
export { resetRegistry } from "./registry_internal.js";
/** 获取所有契约条目 */
export declare function getAllContracts(): ContractRegistryEntry[];
/** 按 contract_id 获取 */
export declare function getContractById(id: string): ContractRegistryEntry | undefined;
/** 按 policy_id 查找对应 contract_id */
export declare function getContractByPolicyId(policyId: string): ContractRegistryEntry | undefined;
/** 按类型列出契约 */
export declare function listContractsByKind(kind: ContractKind): ContractRegistryEntry[];
/** 按状态列出契约 */
export declare function listContractsByState(state: ContractState): ContractRegistryEntry[];
/** 列出所有契约 */
export declare function listContracts(): ContractRegistryEntry[];
/** 注册表汇总统计 */
export declare function getContractRegistrySummary(): ContractRegistrySummary;
/**
 * 判断契约是否允许 hard fail。
 * 只有 state=enforced 且 hard_fail_allowed=true 的契约才能阻断。
 */
export declare function canContractHardFail(contractId: string): boolean;
/**
 * Runtime hard fail gate — 未登记的契约不得 hard fail。
 * 用于运行时检查 workflow 是否引用了合法的 guard/verification/failure 契约。
 */
export declare function runtimeHardFailGate(contractId: string, context: "workflow" | "prompt" | "consumed_by"): {
    allowed: boolean;
    reason: string;
};
/** 注册新契约（运行时） */
export declare function registerContract(entry: ContractRegistryEntry): {
    success: boolean;
    error?: string;
};
/** 工厂函数: 返回 applyContractStateOverride 闭包引用，仅供 ContractStateStore 使用 */
export declare function createContractStateApplier(): (override: {
    contract_id: string;
    new_state: ContractState;
    replacement_contract_id?: string;
    migration_note?: string;
}) => void;
/** 获取所有 policy_id → contract_id 映射 */
export declare function getPolicyToContractMapping(): Array<{
    policy_id: string;
    contract_id: string;
}>;
//# sourceMappingURL=registry.d.ts.map