feat: surface risk rationale to operator in approval prompt

Carry the full RiskSummary (level, signals, rationale) inline on
ApprovalRequestedEvent instead of discarding it after assessment. The two
server-side DTO builders (live ApprovalCoordinator path and replay
DomainEventMapper path) now render real risk level, recommended action,
signal factors, and the [code] rationale lines into the approval WebSocket
message, with a consistent enum-name fallback when no assessment ran (tool
path). RiskSummary/RiskSignal made @Serializable for event embedding;
shared RiskSummary.toDto() lives next to RiskSummaryDto.
This commit is contained in:
2026-05-30 19:08:34 +04:00
parent 8e6a3e1470
commit 780a00229e
11 changed files with 158 additions and 4 deletions
@@ -2,6 +2,7 @@ package com.correx.core.approvals.model
import com.correx.core.approvals.Tier
import com.correx.core.approvals.UserSteering
import com.correx.core.events.risk.RiskSummary
import com.correx.core.events.types.ApprovalRequestId
import com.correx.core.events.types.CausationId
import com.correx.core.events.types.CorrelationId
@@ -16,6 +17,7 @@ data class DomainApprovalRequest(
val tier: Tier,
val validationReportId: ValidationReportId,
val riskSummaryId: RiskSummaryId?,
val riskSummary: RiskSummary? = null,
val timestamp: Instant,
val causationId: CausationId? = null,
val correlationId: CorrelationId? = null,