// spec-migrator/migration-validator.ts — Validation logic for migration results
/**
 * Validate a migration result, returning whether it succeeded
 * and a human-readable summary.
 */
export function validateMigrationResult(result) {
    const hasErrors = result.errors.length > 0;
    const success = result.migratedCount > 0 || !hasErrors;
    const parts = [];
    if (result.migratedCount > 0) {
        parts.push(`${result.migratedCount} spec(s) migrated`);
    }
    if (hasErrors) {
        parts.push(`${result.errors.length} error(s): ${result.errors.join('; ')}`);
    }
    const summary = parts.length > 0 ? parts.join(', ') : 'nothing to migrate';
    return { success, summary, hasErrors };
}
/**
 * Merge two migration results into one.
 * Useful when running multiple migration passes.
 */
export function mergeMigrationResults(a, b) {
    return {
        migratedCount: a.migratedCount + b.migratedCount,
        errors: [...a.errors, ...b.errors],
    };
}
/**
 * Build an empty migration result (zero migrations, no errors).
 */
export function emptyMigrationResult() {
    return { migratedCount: 0, errors: [] };
}
//# sourceMappingURL=migration-validator.js.map