fix(iace): lifecycle labels in benchmark + store all phases

- Store ALL applicable lifecycles (comma-separated) not just first
- Frontend maps internal keys to German labels (normal_operation ->
  Automatikbetrieb, maintenance -> Wartung, etc.)
- Show Betroffene Personen in engine detail column

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-14 23:17:27 +02:00
parent 98e5b1a8aa
commit 29fbd03c79
2 changed files with 19 additions and 6 deletions
@@ -114,6 +114,21 @@ function MatchedTable({ pairs }: { pairs: HazardMatchPair[] }) {
)
}
const LIFECYCLE_LABELS: Record<string, string> = {
startup: 'Hochfahren', homing: 'Referenzfahrt', automatic_operation: 'Automatikbetrieb',
manual_operation: 'Handbetrieb', teach_mode: 'Einrichtbetrieb', maintenance: 'Wartung',
cleaning: 'Reinigung', emergency_stop: 'Not-Halt', recovery_mode: 'Wiederanlauf',
normal_operation: 'Automatikbetrieb', setup: 'Einrichten', changeover: 'Umruesten',
fault_clearing: 'Fehlersuche/Stoerungsbeseitigung', commissioning: 'Inbetriebnahme',
decommissioning: 'Demontage/Ausserbetriebnahme', transport: 'Transport',
assembly: 'Montage/Installation', inspection: 'Inspektion/Pruefung',
}
function formatLifecycles(raw: string): string {
if (!raw) return '-'
return raw.split(',').map(s => s.trim()).map(s => LIFECYCLE_LABELS[s] || s).join(', ')
}
/** Side-by-side detail comparison of GT entry vs. Engine hazard */
function DetailComparison({ gt, engine }: { gt: GroundTruthEntry; engine: HazardSummary }) {
return (
@@ -144,7 +159,7 @@ function DetailComparison({ gt, engine }: { gt: GroundTruthEntry; engine: Hazard
<DetailRow label="Szenario" gt={engine.scenario || engine.description || '-'} />
<DetailRow label="Gefahrenstelle" gt={engine.zone || '-'} />
{engine.lifecycle_phase && (
<DetailRow label="Lebensphasen" gt={engine.lifecycle_phase} />
<DetailRow label="Lebensphasen" gt={formatLifecycles(engine.lifecycle_phase)} />
)}
<DetailRow label="Moeglicher Schaden" gt={engine.possible_harm || '-'} />
<DetailRow label="Trigger" gt={engine.trigger_event || '-'} />