/**
 * Knowledge Asset Migration — 问题五十七核心机制之五。
 *
 * 管理知识资产 schema 变更时的迁移策略:
 * - Migration dry-run（预览影响）
 * - 兼容性报告
 * - 用户修改保护
 * - 迁移优先级（P0→P1→P2→P3）
 */
import type { KnowledgeAssetFrontmatter, KnowledgeAssetKind } from "./knowledge_asset_schema.js";
/** 迁移硬失败发现 — 五字段缺失/无效时返回 */
export interface MigrationHardFailFinding {
    asset_id: string;
    invalid_fields: string[];
    reason_zh: string;
}
/** 迁移计划 */
export interface KnowledgeAssetMigrationPlan {
    plan_id: string;
    created_at: string;
    source_schema_version: string;
    target_schema_version: string;
    affected_assets: string[];
    migration_steps: MigrationStep[];
    dry_run_result?: MigrationDryRunResult;
    compatibility_report?: MigrationCompatibilityReport;
    /** 五字段硬契约失败发现 */
    hard_fail_findings: MigrationHardFailFinding[];
}
/** 迁移步骤 */
export interface MigrationStep {
    priority: "P0" | "P1" | "P2" | "P3";
    description_zh: string;
    asset_kinds: KnowledgeAssetKind[];
    asset_count: number;
    automated: boolean;
    requires_user_confirmation: boolean;
}
/** 迁移 dry-run 结果 */
export interface MigrationDryRunResult {
    total_assets: number;
    assets_to_migrate: number;
    assets_unchanged: number;
    assets_skipped: number;
    assets_with_conflicts: number;
    estimated_breaking_changes: number;
    per_asset_details: Array<{
        asset_id: string;
        will_change: boolean;
        changes: string[];
        breaking: boolean;
    }>;
}
/** 兼容性报告 */
export interface MigrationCompatibilityReport {
    source_version: string;
    target_version: string;
    breaking_changes: string[];
    compatible_changes: string[];
    deprecated_fields: string[];
    new_required_fields: string[];
    migration_required: boolean;
}
/**
 * 规划知识资产迁移。
 */
export declare function planKnowledgeAssetMigration(params: {
    source_version: string;
    target_version: string;
    assets: Array<{
        frontmatter: Partial<KnowledgeAssetFrontmatter>;
        file_path: string;
    }>;
    schema_changes: Array<{
        field: string;
        change_type: "added_required" | "removed" | "renamed" | "type_changed" | "deprecated";
        old_value?: string;
        new_value?: string;
    }>;
}): KnowledgeAssetMigrationPlan;
/**
 * 执行迁移 dry-run — 不修改任何文件，只预览影响。
 */
export declare function runMigrationDryRun(params: {
    assets: Array<{
        frontmatter: Partial<KnowledgeAssetFrontmatter>;
        file_path: string;
    }>;
    schema_changes: Array<{
        field: string;
        change_type: "added_required" | "removed" | "renamed" | "type_changed" | "deprecated";
        old_value?: string;
        new_value?: string;
    }>;
    user_modified_assets: string[];
}): MigrationDryRunResult;
/**
 * 生成兼容性报告。
 */
export declare function generateCompatibilityReport(params: {
    source_version: string;
    target_version: string;
    schema_changes: Array<{
        field: string;
        change_type: "added_required" | "removed" | "renamed" | "type_changed" | "deprecated";
        old_value?: string;
        new_value?: string;
    }>;
}): MigrationCompatibilityReport;
/**
 * 检查用户修改的资产是否会被迁移覆盖。
 */
export declare function checkUserModificationProtection(asset_id: string, user_modified_assets: string[], migration_plan: KnowledgeAssetMigrationPlan): {
    protected: boolean;
    reason_zh: string;
};
//# sourceMappingURL=knowledge_asset_migration.d.ts.map