/** Perception → tracking → prediction → planner → behavior chain with * explicit UNCERTAIN / UNAVAILABLE labeling. */ import Box from '@mui/material/Box'; import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; import type { AgentResult } from '../../types/agentic'; import { EVIDENCE_STATUS_COLORS, KV, PanelTitle } from './common'; interface ChainLink { link: string; status: 'OBSERVED' | 'DERIVED' | 'HYPOTHESIS' | 'UNAVAILABLE'; detail: string; } export default function SafetyChainPanel({ safety }: { safety: AgentResult }) { const chain = (safety.output.chain as ChainLink[] | undefined) ?? []; const kinematics = safety.output.kinematics as Record | undefined; const worst = safety.output.worst_case as Record | undefined; const uncertain = safety.output.behavioral_evidence === 'none'; return ( {uncertain ? ( {String(safety.output.assessment)} ) : null} {chain.map((c, i) => ( {c.link.replace(/_/g, ' ')} {c.status === 'UNAVAILABLE' ? 'UNCERTAIN — no evidence' : c.status} {c.detail} {i < chain.length - 1 ? → : null} ))} {!uncertain && worst ? ( {kinematics ? ( <> ) : null} {String(safety.output.coverage_note ?? '')} ) : null} ); }