feat(events): RepoMapComputedEvent as recorded environment observation

This commit is contained in:
2026-06-04 00:59:27 +04:00
parent a77d9a1288
commit 440c96659d
3 changed files with 77 additions and 0 deletions
@@ -0,0 +1,28 @@
package com.correx.core.events.events
import com.correx.core.events.types.SessionId
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/** A single ranked entry in a repo map: a path, its relevance [score], and symbol names. */
@Serializable
data class RepoMapEntry(
val path: String,
val score: Double,
val symbols: List<String> = emptyList(),
)
/**
* Environment observation (invariant #9): the repo map computed once at the moment it ran.
* Replay reads these recorded facts and never re-scans the filesystem. Paths + symbol names
* only — never file bodies — so it is referenced, not inlined.
*/
@Serializable
@SerialName("RepoMapComputed")
data class RepoMapComputedEvent(
val sessionId: SessionId,
val repoRoot: String,
val entries: List<RepoMapEntry>,
val computedAt: Instant,
) : EventPayload
@@ -24,6 +24,7 @@ import com.correx.core.events.events.ModelUnloadedEvent
import com.correx.core.events.events.OrchestrationPausedEvent
import com.correx.core.events.events.OrchestrationResumedEvent
import com.correx.core.events.events.RefinementIterationEvent
import com.correx.core.events.events.RepoMapComputedEvent
import com.correx.core.events.events.RetryAttemptedEvent
import com.correx.core.events.events.RiskAssessedEvent
import com.correx.core.events.events.StageCompletedEvent
@@ -80,6 +81,7 @@ val eventModule = SerializersModule {
subclass(WorkflowCompletedEvent::class)
subclass(RetryAttemptedEvent::class)
subclass(RefinementIterationEvent::class)
subclass(RepoMapComputedEvent::class)
subclass(RiskAssessedEvent::class)
subclass(ChatSessionStartedEvent::class)
subclass(ChatTurnEvent::class)