feat(iace): Sprint 4D — Failure Mode Layer (FMEA-Faehigkeit)

150 Failure Modes in 11 ComponentTypes:
- Sensor (20): Signalverlust, Drift, Falschmeldung, Encoder-spezifisch
- Controller (20): Watchdog, Speicher, Bus, Safety-SPS CCF, Antrieb
- Actuator (15): Blockiert, Ueberlast, Haltekraftverlust, Schuetz verschweisst
- Mechanical (20): Ermuedungsbruch, Lagerschaden, Kettenriss, Werkzeugbruch
- Electrical (15): Isolation, Kurzschluss, Erdschluss, Lichtbogen
- Software (15): Exception, Race Condition, Buffer Overflow, Timing
- Hydraulic/Pneumatic (15): Schlauchplatzer, Ventil blockiert, Kavitation
- Safety Device (15): Failure-to-trip, CCF, Bremsenverschleiss, PL-Degradation
- Network (10): Paketverlust, Latenz, Man-in-the-Middle
- AI/ML (5): Model Drift, Adversarial Input, Bias

Architektur:
- FailureModeEntry Struct mit FMEA-Scores (Severity/Occurrence/Detection 1-10)
- RPZ = S x O x D (max 1000, Schwelle >= 100 = Massnahme erforderlich)
- RequiredFailureModes auf HazardPattern fuer FM-gesteuertes Pattern-Matching
- MatchInput.FailureModes + MatchReason "failure_mode" (Explainability)
- GET /failure-modes?component_type= API-Endpoint

10 Tests: Count, UniqueIDs, ValidTypes, NonEmpty, Distribution, RPZ (3x), NilFires, RPZDistribution

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-10 22:24:02 +02:00
parent 9cbbc6ee2f
commit 9c0d471277
8 changed files with 448 additions and 2 deletions
+27
View File
@@ -88,6 +88,33 @@ func DeriveHazardType(h *Hazard) string {
return DefaultHazardType
}
// FailureModeEntry represents a potential failure mode for a component type.
// Used for FMEA (Failure Mode and Effects Analysis) — the chain is:
// Component → FailureMode → HazardousSituation → Harm.
type FailureModeEntry struct {
ID string `json:"id"` // e.g. "FM-SEN-01"
ComponentType string `json:"component_type"` // e.g. "sensor", "controller"
Mode string `json:"mode"` // e.g. "loss_of_signal", "drift"
NameDE string `json:"name_de"`
NameEN string `json:"name_en"`
Effect string `json:"effect"` // System-level effect
DetectionHint string `json:"detection_hint"` // How to detect this failure
// FMEA scores (each 1-10)
DefaultSeverity int `json:"default_severity"` // Impact severity
DefaultOccurrence int `json:"default_occurrence"` // How often it occurs
DefaultDetection int `json:"default_detection"` // Detectability (10=undetectable, 1=immediately detectable)
}
// CalculateRPZ computes the Risk Priority Number for a failure mode.
// RPZ = Severity × Occurrence × Detection. Range: 1-1000.
// RPZ > 100: action required. RPZ > 200: critical.
func (fm *FailureModeEntry) CalculateRPZ() int {
return fm.DefaultSeverity * fm.DefaultOccurrence * fm.DefaultDetection
}
// RPZThresholdAction is the RPZ value above which corrective action is required.
const RPZThresholdAction = 100
// AssessmentType represents the type of risk assessment
type AssessmentType string