package com.correx.core.events.events

import kotlinx.serialization.Serializable

/** Which critic role produced a [CritiqueFinding]. */
@Serializable
enum class CritiqueRole { PLAN_CRITIC, CODE_REVIEWER }

/** Severity of a [CritiqueFinding], highest-impact first. */
@Serializable
enum class CritiqueSeverity { BLOCKER, MAJOR, MINOR, NIT }

/**
 * One structured finding emitted by a critic (plan critic) or reviewer (code reviewer),
 * replacing the free-text verdict prose those roles produced before. Shared by both roles so
 * findings can be counted, ranked, and calibrated uniformly.
 *
 * [id] is a stable identifier for the finding, used to correlate it with its eventual outcome
 * (see [CritiqueOutcomeCorrelatedEvent]). [category] is a free-form classification
 * (e.g. "correctness", "missing_requirement", "style"). [location] optionally points at a
 * `file:line` or an artifact/stage reference the finding concerns.
 *
 * Distinct from `core.validation.ValidationIssue`, which models *structural* validation
 * (graph/schema) rather than a critic's judgement.
 */
@Serializable
data class CritiqueFinding(
    val id: String,
    val role: CritiqueRole,
    val severity: CritiqueSeverity,
    val category: String,
    val message: String,
    val location: String? = null,
)
