102
*/
103
export function toGuardianAssessmentEventJson(notification: ItemGuardianApprovalReviewCompletedNotification): JsonValue {
105
>
id: notification.reviewId,
106
>
turn_id: notification.turnId,
107
>
started_at_ms: notification.startedAtMs,
108
>
status: guardianStatusToEvent(notification.review.status),
109
>
action: guardianReviewActionToEventAction(notification.action),
110
>
};
111
>
if (notification.targetItemId !== null) {
112
event.target_item_id = notification.targetItemId;
113
}
114
>
if (notification.completedAtMs !== null && notification.completedAtMs !== undefined) {
codexGuardianReview.ts
115
>
event.completed_at_ms = notification.completedAtMs;
116
>
}
117
>
if (notification.review.riskLevel !== null) {
118
event.risk_level = notification.review.riskLevel;
119
}
121
event.user_authorization = notification.review.userAuthorization;
122
}
124
event.rationale = notification.review.rationale;
125
}
126
>
if (notification.decisionSource !== null && notification.decisionSource !== undefined) {
codexGuardianReview.ts
127
>
event.decision_source = notification.decisionSource;
128
>
}
129
>
return event;
130
>
}
131
132
/** A human-readable summary of a reviewed action for the approval card. */