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:
@@ -86,6 +86,31 @@ func (h *IACEHandler) ListProtectiveMeasures(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// ListFailureModes handles GET /failure-modes
|
||||
// Returns the failure mode library, optionally filtered by ?component_type.
|
||||
func (h *IACEHandler) ListFailureModes(c *gin.Context) {
|
||||
componentType := c.Query("component_type")
|
||||
|
||||
all := iace.GetFailureModeLibrary()
|
||||
|
||||
var filtered []iace.FailureModeEntry
|
||||
for _, entry := range all {
|
||||
if componentType != "" && entry.ComponentType != componentType {
|
||||
continue
|
||||
}
|
||||
filtered = append(filtered, entry)
|
||||
}
|
||||
|
||||
if filtered == nil {
|
||||
filtered = []iace.FailureModeEntry{}
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"failure_modes": filtered,
|
||||
"total": len(filtered),
|
||||
})
|
||||
}
|
||||
|
||||
// ValidateMitigationHierarchy handles POST /projects/:id/validate-mitigation-hierarchy
|
||||
// Validates if the proposed mitigation type follows the 3-step hierarchy principle.
|
||||
func (h *IACEHandler) ValidateMitigationHierarchy(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user