// src/engine/skill-generator/conventions-hasher.ts — SPEC-685
// Computes a stable hash of the ProjectKnowledge fields that affect skill content.
// Used for idempotency: only regenerate skills when conventions actually changed.
import { createHash } from 'node:crypto';
function extractConventions(knowledge) {
    return {
        packageManager: knowledge.packageManager,
        testCommand: knowledge.testCommand,
        buildCommand: knowledge.buildCommand,
        lintCommand: knowledge.lintCommand,
        language: knowledge.language,
        framework: knowledge.framework,
    };
}
/**
 * Hash the subset of ProjectKnowledge fields that affect skill content.
 * Returns a short hex string suitable for embedding in a comment marker.
 */
export function hashConventions(knowledge) {
    const subset = extractConventions(knowledge);
    const json = JSON.stringify(subset);
    return createHash('sha256').update(json).digest('hex').slice(0, 16);
}
//# sourceMappingURL=conventions-hasher.js.map