// ─── Converters ─────────────────────────────────────
/** Convert a lint Violation into a unified TotemFinding. */
export function violationToFinding(v) {
    return {
        id: v.rule.lessonHash,
        source: 'lint',
        severity: v.rule.severity ?? 'error',
        message: v.rule.message,
        file: v.file,
        line: v.lineNumber,
        matchedLine: v.line,
        ruleHeading: v.rule.lessonHeading,
        confidence: 1.0,
        category: v.rule.category,
    };
}
/** Reconstruct the CompiledRule + Violation from a lint-sourced TotemFinding (for SARIF compat). */
export function findingToViolation(f, ruleMap) {
    const rule = ruleMap.get(f.id);
    if (!rule)
        return null;
    return {
        rule,
        file: f.file ?? '',
        line: f.matchedLine ?? '',
        lineNumber: f.line ?? 0,
    };
}
//# sourceMappingURL=finding.js.map