feat(t208): close candidate decision feedback loop

This commit is contained in:
QiuSW
2026-07-28 11:57:25 +08:00
parent 2a5ded42b5
commit e7f4c3e114
35 changed files with 2854 additions and 203 deletions
@@ -216,6 +216,17 @@ func executionReportFrom(report *domain.ExecutionReport) *ExecutionReport {
result.Candidates = prettyAuditJSON(&batch.CandidatesJSON)
result.Recommendation = prettyAuditJSON(batch.RecommendationJSON)
}
if dataset := report.DecisionDataset; dataset != nil {
result.Observations = prettyValueJSON(dataset.Observations)
result.ModelPredictions = prettyValueJSON(map[string]any{
"model_run": dataset.ModelRun,
"evaluations": dataset.Evaluations,
})
result.DeterministicRecommendation = prettyValueJSON(
dataset.Recommendation,
)
result.HumanReviews = prettyValueJSON(dataset.HumanReviews)
}
if outcome := report.Outcome; outcome != nil {
result.Outcome = &ExecutionReportOutcome{
ResultType: outcome.ResultType,
@@ -247,6 +258,17 @@ func prettyAuditJSON(value *string) string {
return string(formatted)
}
func prettyValueJSON(value any) string {
if value == nil {
return ""
}
formatted, err := json.MarshalIndent(value, "", " ")
if err != nil || string(formatted) == "null" || string(formatted) == "[]" {
return ""
}
return string(formatted)
}
func stringValue(value *string) string {
if value == nil {
return ""