package com.correx.core.events.events

import com.correx.core.events.types.SessionId
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
 * How a prior [CritiqueFinding] actually turned out once the surrounding loop resolved.
 * UPHELD = the finding was confirmed/actioned; DISMISSED = rejected as a false positive;
 * INCONCLUSIVE = no signal either way.
 */
@Serializable
enum class CritiqueOutcome { UPHELD, DISMISSED, INCONCLUSIVE }

/**
 * Correlates one prior [CritiqueFinding] (by [findingId]) with how it actually turned out, so a
 * critic's precision can be tracked per model and per role over time (the calibration projection
 * in `:core:critique`). [modelHash] identifies the model that produced the finding; [severity]
 * is carried so calibration can be sliced by severity band without re-reading the finding.
 *
 * This is the recording half only — who decides UPHELD/DISMISSED lives in the reviewer-loop
 * runtime and is wired separately.
 */
@Serializable
@SerialName("CritiqueOutcomeCorrelated")
data class CritiqueOutcomeCorrelatedEvent(
    val sessionId: SessionId,
    val findingId: String,
    val role: CritiqueRole,
    val modelHash: String,
    val severity: CritiqueSeverity,
    val outcome: CritiqueOutcome,
) : EventPayload
