package com.correx.core.events.events

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

/**
 * Records that freeform context up through session sequence [coversThroughSequence] was
 * summarized into [summaryArtifactId] at tier [tier]. Keyed on the stable event sequence (not
 * the ephemeral per-assembly pack ordinal, which is re-stamped each build) so replay reuses
 * the recorded summary deterministically and never re-calls the LLM (invariants #6/#8).
 * [tier] 2 = light single-pass summary, 3 = summary-of-summaries.
 */
@Serializable
@SerialName("ContextSummarized")
data class ContextSummarizedEvent(
    val sessionId: SessionId,
    val coversThroughSequence: Long,
    val summaryArtifactId: ArtifactId,
    val tier: Int,
    val entriesOmittedCount: Int,
) : EventPayload
