feat(iace): show lifecycle phases + affected persons in benchmark detail

Backend: HazardSummary now includes lifecycle_phase and affected_person
Frontend: Engine detail column shows Lebensphasen and Betroffene Personen

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-14 23:10:15 +02:00
parent b175212516
commit 98e5b1a8aa
4 changed files with 31 additions and 20 deletions
@@ -143,8 +143,14 @@ function DetailComparison({ gt, engine }: { gt: GroundTruthEntry; engine: Hazard
<DetailRow label="Gefaehrdung" gt={engine.name} /> <DetailRow label="Gefaehrdung" gt={engine.name} />
<DetailRow label="Szenario" gt={engine.scenario || engine.description || '-'} /> <DetailRow label="Szenario" gt={engine.scenario || engine.description || '-'} />
<DetailRow label="Gefahrenstelle" gt={engine.zone || '-'} /> <DetailRow label="Gefahrenstelle" gt={engine.zone || '-'} />
{engine.lifecycle_phase && (
<DetailRow label="Lebensphasen" gt={engine.lifecycle_phase} />
)}
<DetailRow label="Moeglicher Schaden" gt={engine.possible_harm || '-'} /> <DetailRow label="Moeglicher Schaden" gt={engine.possible_harm || '-'} />
<DetailRow label="Trigger" gt={engine.trigger_event || '-'} /> <DetailRow label="Trigger" gt={engine.trigger_event || '-'} />
{engine.affected_person && (
<DetailRow label="Betroffene Personen" gt={engine.affected_person} />
)}
{engine.mitigations && engine.mitigations.length > 0 ? ( {engine.mitigations && engine.mitigations.length > 0 ? (
<DetailRow label="Massnahmen" gt={engine.mitigations.join('\n')} multiline /> <DetailRow label="Massnahmen" gt={engine.mitigations.join('\n')} multiline />
) : ( ) : (
@@ -33,6 +33,7 @@ export interface HazardSummary {
component?: string; zone?: string; risk_level?: string component?: string; zone?: string; risk_level?: string
description?: string; scenario?: string description?: string; scenario?: string
possible_harm?: string; trigger_event?: string possible_harm?: string; trigger_event?: string
affected_person?: string; lifecycle_phase?: string
mitigations?: string[] mitigations?: string[]
} }
@@ -68,15 +68,17 @@ func CompareBenchmark(gt *GroundTruth, hazards []Hazard, mitigations []Mitigatio
engineSummaries := make([]HazardSummary, len(hazards)) engineSummaries := make([]HazardSummary, len(hazards))
for i, h := range hazards { for i, h := range hazards {
engineSummaries[i] = HazardSummary{ engineSummaries[i] = HazardSummary{
ID: h.ID.String(), ID: h.ID.String(),
Name: h.Name, Name: h.Name,
Category: h.Category, Category: h.Category,
Zone: h.HazardousZone, Zone: h.HazardousZone,
Description: h.Description, Description: h.Description,
Scenario: h.Scenario, Scenario: h.Scenario,
PossibleHarm: h.PossibleHarm, PossibleHarm: h.PossibleHarm,
TriggerEvent: h.TriggerEvent, TriggerEvent: h.TriggerEvent,
Mitigations: mitNamesByHazard[h.ID.String()], AffectedPerson: h.AffectedPerson,
LifecyclePhase: h.LifecyclePhase,
Mitigations: mitNamesByHazard[h.ID.String()],
} }
} }
@@ -92,17 +92,19 @@ type HazardMatchPair struct {
// HazardSummary is a hazard representation for benchmark results with detail fields. // HazardSummary is a hazard representation for benchmark results with detail fields.
type HazardSummary struct { type HazardSummary struct {
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Category string `json:"category"` Category string `json:"category"`
Component string `json:"component,omitempty"` Component string `json:"component,omitempty"`
Zone string `json:"zone,omitempty"` Zone string `json:"zone,omitempty"`
RiskLevel string `json:"risk_level,omitempty"` RiskLevel string `json:"risk_level,omitempty"`
Description string `json:"description,omitempty"` Description string `json:"description,omitempty"`
Scenario string `json:"scenario,omitempty"` Scenario string `json:"scenario,omitempty"`
PossibleHarm string `json:"possible_harm,omitempty"` PossibleHarm string `json:"possible_harm,omitempty"`
TriggerEvent string `json:"trigger_event,omitempty"` TriggerEvent string `json:"trigger_event,omitempty"`
Mitigations []string `json:"mitigations,omitempty"` AffectedPerson string `json:"affected_person,omitempty"`
LifecyclePhase string `json:"lifecycle_phase,omitempty"`
Mitigations []string `json:"mitigations,omitempty"`
} }
// CategoryScore shows coverage per ISO 12100 hazard group. // CategoryScore shows coverage per ISO 12100 hazard group.