fix: wire routerConnected flag, expandable diffs, stage in session list, ArtifactCreated mapping

This commit is contained in:
2026-05-29 17:04:33 +04:00
parent fb3ab9b344
commit 7c55a53a9f
13 changed files with 83 additions and 13 deletions
@@ -5,6 +5,7 @@ import com.correx.apps.server.protocol.RiskSummaryDto
import com.correx.apps.server.protocol.ServerMessage
import com.correx.core.artifactstore.ArtifactStore
import com.correx.core.events.events.ApprovalRequestedEvent
import com.correx.core.events.events.ArtifactCreatedEvent
import com.correx.core.events.events.ChatSessionStartedEvent
import com.correx.core.events.events.InferenceCompletedEvent
import com.correx.core.events.events.WorkflowStartedEvent
@@ -157,6 +158,13 @@ suspend fun domainEventToServerMessage(
)
is ApprovalRequestedEvent -> mapApprovalRequested(p, seq, sessionSequence)
is ArtifactCreatedEvent -> ServerMessage.ArtifactCreated(
sessionId = p.sessionId,
stageId = p.stageId,
artifactId = p.artifactId,
sequence = seq,
sessionSequence = sessionSequence,
)
else -> {
log.debug(
"DomainEventMapper: unmapped payload type={} sessionId={} sequence={}",
@@ -19,6 +19,7 @@ import com.correx.core.events.events.InferenceStartedEvent
import com.correx.core.events.events.InferenceTimeoutEvent
import com.correx.core.events.events.NewEvent
import com.correx.core.events.events.ApprovalRequestedEvent
import com.correx.core.events.events.ArtifactCreatedEvent
import com.correx.core.events.events.OrchestrationPausedEvent
import com.correx.core.events.events.OrchestrationResumedEvent
import com.correx.core.events.events.StageCompletedEvent
@@ -183,6 +184,7 @@ class SessionEventBridge(
is OrchestrationPausedEvent -> EventEntryDto(ts, "SessionPaused", p.reason)
is WorkflowCompletedEvent -> EventEntryDto(ts, "SessionCompleted", "")
is WorkflowFailedEvent -> EventEntryDto(ts, "SessionFailed", p.reason)
is ArtifactCreatedEvent -> EventEntryDto(ts, "ArtifactCreated", p.artifactId.value)
else -> null
}
}
@@ -2,6 +2,7 @@ package com.correx.apps.server.protocol
import com.correx.core.approvals.Tier
import com.correx.core.events.types.ApprovalRequestId
import com.correx.core.events.types.ArtifactId
import com.correx.core.events.types.SessionId
import com.correx.core.events.types.StageId
import kotlinx.serialization.SerialName
@@ -251,6 +252,18 @@ sealed interface ServerMessage {
override val sessionSequence: Long? = null,
) : ServerMessage, NonEventMessage
// -- Artifacts --
@Serializable
@SerialName("artifact.created")
data class ArtifactCreated(
val sessionId: SessionId,
val stageId: StageId,
val artifactId: ArtifactId,
override val sequence: Long,
override val sessionSequence: Long,
) : ServerMessage, SessionMessage
// -- Router --
@Serializable