package com.correx.core.events.events

import com.correx.core.events.risk.RiskAction
import com.correx.core.events.types.SessionId
import com.correx.core.events.types.StageId
import com.correx.core.events.types.ToolInvocationId
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class AssessedIssue(
    val code: String,
    val message: String,
    val severity: String,
)

@Serializable
data class ToolCallObservation(
    val ruleCode: String,
    val facts: Map<String, String> = emptyMap(),
)

@Serializable
@SerialName("ToolCallAssessed")
data class ToolCallAssessedEvent(
    val invocationId: ToolInvocationId,
    val sessionId: SessionId,
    val stageId: StageId,
    val toolName: String,
    val issues: List<AssessedIssue> = emptyList(),
    val observations: List<ToolCallObservation> = emptyList(),
    val disposition: RiskAction,
    val timestampMs: Long,
) : EventPayload
