package com.correx.core.events.events

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

@Serializable
data class RepoKnowledgeHit(
    val path: String,
    val text: String,
    val score: Float,
)

/**
 * Result of semantic retrieval over the embedded repo map for a stage (invariant #9):
 * recorded at retrieval time; replay and downstream context assembly read the hits from
 * this event, never re-query the vector index.
 */
@Serializable
@SerialName("RepoKnowledgeRetrieved")
data class RepoKnowledgeRetrievedEvent(
    val sessionId: SessionId,
    val stageId: StageId,
    val query: String,
    val hits: List<RepoKnowledgeHit>,
) : EventPayload
