6a3e96d54c
Two-part nachhaltiger fix replacing the previous "fill to 5 mitigations no matter what" behavior that the GT-Bremse benchmark proved unfaithful (e.g. HP1625 "scharfe Kanten" returning M005 "Rotations- bewegung vermeiden" via category fallback; HP1651 "Wiederanlauf Roboter" returning M054 "Sichere thermische Auslegung" via mismatched pattern reference). PART A — Set-based category filter (handlers package): - acceptableMeasureCategories: replaces 1:1 patternCatToMeasureCat with a curated set per pattern category, so e.g. safety_function_failure now accepts software_control measures (watchdogs, plausibility checks) and emc_hazard accepts both electrical and software_control measures - isCategoryCompatible: gate every measure id against the accepted set before creating a mitigation; mismatches log MEASURE-SKIP - The old category fallback is REMOVED. A hazard whose pattern has no category-compatible measure is now created with zero mitigations and logged as COVERAGE-GAP — the operator must consult an expert. No more silent invention of generic defaults. PART B — 235 pattern author-error fixes across 26 files: - HP040-HP044 (AI): M101/M102/M103 (Auffangwanne/Absauganlage) -> M133 Anomalieerkennung + M214 Plausibilitaet + M213 Sensor-Redundanz + M044 Zweikanalige Steuerung + others - HP011-HP015, HP104-HP109, HP1085-HP1095, HP1281-HP1334 (electrical): M001-M005/M054/M061 placeholders -> M481/M482 Isolation + M511-M522 PE/Schutzleiter/RCD/Hauptschalter - HP110-HP1331 (material_environmental): M101-M103 -> M384-M395 Brandschutz/Laserschutz + M533/M408 SDB/PSA - HP800-HP858, HP1178-HP1264 (software/sensor/hmi): M101/M104 -> M105/M106/M107/M214 SPS/Watchdog/Plausibilitaet - HP026, HP611-HP1690 (ergonomic): M001/M082 -> M353-M360 + M530-M532 Hebehilfe/ergonomische Hoehe - HP201-HP1697 (mechanical): M054/M051 -> M002/M008/M061/M141 + M487/M488 Tueroeffnung-Stillsetzung/Wiederanlauf - Plus EMF/Strahlung/Brand/Lärm/Vibration/Kommunikation/Cyber Coverage shift (Pattern-Author-Fehler bei aktiviertem Set-Filter): start: 237 patterns with zero category-compatible measures after Stufe 1A: 5 (AI) after Stufe 1B: 20 (mechanical Bestand) after Stufe 1C: 35 (electrical Bestand) after Stufe 1D: 29 (material_environmental) after Stufe 1E: 29 (software/sensor/hmi) after Stufe 1F: 20 (ergonomic) after Stufe 1G: 80 (thermal/comm/radiation/fire/safety) final: 0 (28 extended.go/extended2.go duplicates fixed) New regression tests: - TestEveryPattern_HasCategoryCompatibleMeasure: every pattern in collectAllPatterns() must reference at least one category-compatible measure; gaps must be explicitly listed in AllowlistKnownGaps (currently empty). Fails CI for any new pattern that drifts. - TestAcceptableMeasureCategories: pins the set-mapping for the 7 most-bug-prone pattern categories. - TestIsCategoryCompatible_EmptyMeasureCat: protects legacy entries. A separate task #11 tracks 58 HP-ID duplicates between extended.go/extended2.go and cobot.go/press.go/operational.go — patterns are semantically different and TestGetBuiltinHazardPatterns_- UniqueIDs misses them because it only checks HP001-HP044. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
328 lines
14 KiB
Go
328 lines
14 KiB
Go
package iace
|
|
|
|
// getExtendedHazardPatternsB returns patterns HP074-HP102.
|
|
// Called by GetExtendedHazardPatterns in hazard_patterns_extended.go.
|
|
func getExtendedHazardPatternsB() []HazardPattern {
|
|
return []HazardPattern{
|
|
{
|
|
ID: "HP074", NameDE: "Industrie-Switch — elektrisch", NameEN: "Industrial Switch — electrical",
|
|
RequiredComponentTags: []string{"networked", "security_device"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"communication_failure"},
|
|
SuggestedMeasureIDs: []string{"M113", "M106", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E08"},
|
|
Priority: 70,
|
|
// Source: R075, R329, R585, R1085
|
|
},
|
|
{
|
|
ID: "HP075", NameDE: "Laserscanner — elektrisch", NameEN: "Laser Scanner — electrical",
|
|
RequiredComponentTags: []string{"sensor_part"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"sensor_fault"},
|
|
SuggestedMeasureIDs: []string{"M106"},
|
|
SuggestedEvidenceIDs: []string{"E08", "E09"},
|
|
Priority: 70,
|
|
// Source: R583, R1083
|
|
},
|
|
{
|
|
ID: "HP076", NameDE: "Hubwerk — mechanisch", NameEN: "Lifting Device — mechanical",
|
|
RequiredComponentTags: []string{"gravity_risk", "high_force", "moving_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"operation", "transport"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M004", "M005"},
|
|
SuggestedEvidenceIDs: []string{"E08", "E20"},
|
|
Priority: 80,
|
|
// Source: R307, R308
|
|
},
|
|
{
|
|
ID: "HP077", NameDE: "Hubtisch — hydraulisch", NameEN: "Lifting Table — hydraulic",
|
|
RequiredComponentTags: []string{"gravity_risk", "moving_part"},
|
|
RequiredEnergyTags: []string{"hydraulic_pressure"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M482", "M481", "M522", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E11"},
|
|
Priority: 80,
|
|
// Source: R560, R1060
|
|
},
|
|
{
|
|
ID: "HP078", NameDE: "Linearachse — mechanisch", NameEN: "Linear Axis — mechanical",
|
|
RequiredComponentTags: []string{"crush_point", "moving_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"automatic_operation", "maintenance", "setup"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M003", "M051", "M054", "M106", "M121", "M131"},
|
|
SuggestedEvidenceIDs: []string{"E08", "E09", "E20", "E21"},
|
|
Priority: 80,
|
|
// Source: R051, R052, R301, R302
|
|
},
|
|
{
|
|
ID: "HP079", NameDE: "Maschinenrahmen — mechanisch", NameEN: "Machine Frame — mechanical",
|
|
RequiredComponentTags: []string{"structural_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M005"},
|
|
SuggestedEvidenceIDs: []string{"E07"},
|
|
Priority: 80,
|
|
// Source: R335, R593, R1093
|
|
},
|
|
{
|
|
ID: "HP080", NameDE: "ML-Modell — Software", NameEN: "Ml Model — software",
|
|
RequiredComponentTags: []string{"has_ai", "has_software"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"model_drift"},
|
|
SuggestedMeasureIDs: []string{"M133", "M227", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E15"},
|
|
Priority: 75,
|
|
// Source: R078, R332, R589, R1089
|
|
},
|
|
{
|
|
ID: "HP081", NameDE: "Ueberwachungssystem — elektrisch", NameEN: "Monitoring System — electrical",
|
|
RequiredComponentTags: []string{"has_software", "safety_device"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"sensor_fault"},
|
|
SuggestedMeasureIDs: []string{"M106"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 70,
|
|
// Source: R337, R595, R1095
|
|
},
|
|
{
|
|
ID: "HP082", NameDE: "Palettierer — mechanisch", NameEN: "Palletizer — mechanical",
|
|
RequiredComponentTags: []string{"high_force", "moving_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"automatic_operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M004"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 80,
|
|
// Source: R559, R1059
|
|
},
|
|
{
|
|
ID: "HP083", NameDE: "Plattform — mechanisch", NameEN: "Platform — mechanical",
|
|
RequiredComponentTags: []string{"gravity_risk", "structural_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M061", "M002", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 80,
|
|
// Source: R336, R594, R1094
|
|
},
|
|
{
|
|
ID: "HP084", NameDE: "Pneumatikzylinder — pneumatisch", NameEN: "Pneumatic Cylinder — pneumatic",
|
|
RequiredComponentTags: []string{"moving_part", "pneumatic_part", "stored_energy"},
|
|
RequiredEnergyTags: []string{"pneumatic_pressure"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M022"},
|
|
SuggestedEvidenceIDs: []string{"E08"},
|
|
Priority: 80,
|
|
// Source: R069, R323, R576, R1076
|
|
},
|
|
{
|
|
ID: "HP085", NameDE: "Pneumatikleitung — pneumatisch", NameEN: "Pneumatic Line — pneumatic",
|
|
RequiredComponentTags: []string{"pneumatic_part"},
|
|
RequiredEnergyTags: []string{"pneumatic_pressure"},
|
|
RequiredLifecycles: []string{"maintenance"},
|
|
GeneratedHazardCats: []string{"pneumatic_hydraulic"},
|
|
SuggestedMeasureIDs: []string{"M021"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 70,
|
|
// Source: R324, R577, R1077
|
|
},
|
|
{
|
|
ID: "HP086", NameDE: "Stromversorgung — elektrisch", NameEN: "Power Supply — electrical",
|
|
RequiredComponentTags: []string{"electrical_part", "high_voltage"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"maintenance", "operation"},
|
|
GeneratedHazardCats: []string{"electrical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M481", "M482", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E14", "E20"},
|
|
Priority: 80,
|
|
// Source: R063, R311, R312, R568, R1068
|
|
},
|
|
{
|
|
ID: "HP087", NameDE: "Naeherungssensor — elektrisch", NameEN: "Proximity Sensor — electrical",
|
|
RequiredComponentTags: []string{"sensor_part"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"sensor_fault"},
|
|
SuggestedMeasureIDs: []string{"M214", "M119", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E08"},
|
|
Priority: 70,
|
|
// Source: R073, R327, R582, R1082
|
|
},
|
|
{
|
|
ID: "HP088", NameDE: "Roboterarm — mechanisch", NameEN: "Robot Arm — mechanical",
|
|
RequiredComponentTags: []string{"high_force", "moving_part", "rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"automatic_operation", "maintenance", "teach"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M051", "M082", "M106", "M121", "M131"},
|
|
SuggestedEvidenceIDs: []string{"E08", "E09", "E21"},
|
|
Priority: 80,
|
|
// Source: R303, R304, R551, R552, R1051, R1052
|
|
},
|
|
{
|
|
ID: "HP089", NameDE: "Robotersteuerung — elektrisch", NameEN: "Robot Controller — electrical",
|
|
RequiredComponentTags: []string{"has_software", "programmable"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"software_fault"},
|
|
SuggestedMeasureIDs: []string{"M533", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 70,
|
|
// Source: R553, R1053
|
|
},
|
|
{
|
|
ID: "HP090", NameDE: "Greifer — mechanisch", NameEN: "Robot Gripper — mechanical",
|
|
RequiredComponentTags: []string{"clamping_part", "moving_part", "pinch_point"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"automatic_operation", "operation", "setup"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M003", "M004", "M106"},
|
|
SuggestedEvidenceIDs: []string{"E08"},
|
|
Priority: 80,
|
|
// Source: R057, R058, R554
|
|
},
|
|
{
|
|
ID: "HP091", NameDE: "Greifer — pneumatisch", NameEN: "Robot Gripper — pneumatic",
|
|
RequiredComponentTags: []string{"clamping_part", "moving_part", "pinch_point"},
|
|
RequiredEnergyTags: []string{"pneumatic_pressure"},
|
|
RequiredLifecycles: []string{"maintenance", "operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard", "pneumatic_hydraulic"},
|
|
SuggestedMeasureIDs: []string{"M004", "M021"},
|
|
SuggestedEvidenceIDs: []string{"E08", "E20"},
|
|
Priority: 80,
|
|
// Source: R555, R1054, R1055
|
|
},
|
|
{
|
|
ID: "HP092", NameDE: "Rollenfoerderer — mechanisch", NameEN: "Roller Conveyor — mechanical",
|
|
RequiredComponentTags: []string{"entanglement_risk", "moving_part", "rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M061", "M002", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 80,
|
|
// Source: R558, R1058
|
|
},
|
|
{
|
|
ID: "HP093", NameDE: "Drehtisch — mechanisch", NameEN: "Rotary Table — mechanical",
|
|
RequiredComponentTags: []string{"high_force", "rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"automatic_operation", "maintenance"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M051", "M054", "M121", "M131"},
|
|
SuggestedEvidenceIDs: []string{"E14", "E21"},
|
|
Priority: 80,
|
|
// Source: R309, R310
|
|
},
|
|
{
|
|
ID: "HP094", NameDE: "Drehscheibe — mechanisch", NameEN: "Rotating Disc — mechanical",
|
|
RequiredComponentTags: []string{"high_speed", "rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M061", "M002", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 80,
|
|
// Source: R565, R1065
|
|
},
|
|
{
|
|
ID: "HP095", NameDE: "Spindel — mechanisch", NameEN: "Rotating Spindle — mechanical",
|
|
RequiredComponentTags: []string{"cutting_part", "high_speed", "rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"maintenance", "operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M051", "M121", "M131"},
|
|
SuggestedEvidenceIDs: []string{"E20", "E21"},
|
|
Priority: 80,
|
|
// Source: R561, R562, R1061, R1062
|
|
},
|
|
{
|
|
ID: "HP096", NameDE: "Router — elektrisch", NameEN: "Router — electrical",
|
|
RequiredComponentTags: []string{"networked", "security_device"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"unauthorized_access"},
|
|
SuggestedMeasureIDs: []string{"M101", "M113"},
|
|
SuggestedEvidenceIDs: []string{"E16", "E17"},
|
|
Priority: 85,
|
|
// Source: R076, R330, R586, R1086
|
|
},
|
|
{
|
|
ID: "HP097", NameDE: "Gesamtsystem — gemischt", NameEN: "System — mixed",
|
|
RequiredComponentTags: []string{"has_software"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"operation", "safety_validation"},
|
|
GeneratedHazardCats: []string{"software_fault"},
|
|
SuggestedMeasureIDs: []string{"M082", "M106"},
|
|
SuggestedEvidenceIDs: []string{"E14", "E15"},
|
|
Priority: 70,
|
|
// Source: R599, R600, R1099, R1100
|
|
},
|
|
{
|
|
ID: "HP098", NameDE: "Werkzeugwechsler — mechanisch", NameEN: "Tool Changer — mechanical",
|
|
RequiredComponentTags: []string{"moving_part", "pinch_point"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"maintenance", "operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M061", "M002", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E14", "E20"},
|
|
Priority: 80,
|
|
// Source: R059, R060
|
|
},
|
|
{
|
|
ID: "HP099", NameDE: "Touch-Bedienfeld — Software", NameEN: "Touch Interface — software",
|
|
RequiredComponentTags: []string{"has_software", "user_interface"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"hmi_error"},
|
|
SuggestedMeasureIDs: []string{"M101", "M113"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 70,
|
|
// Source: R592, R1092
|
|
},
|
|
{
|
|
ID: "HP100", NameDE: "Transformator — elektrisch", NameEN: "Transformer — electrical",
|
|
RequiredComponentTags: []string{"electrical_part", "high_voltage"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"inspection", "operation"},
|
|
GeneratedHazardCats: []string{"electrical_hazard", "thermal_hazard"},
|
|
SuggestedMeasureIDs: []string{"M481", "M477", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E10"},
|
|
Priority: 80,
|
|
// Source: R064, R313, R314, R569, R1069
|
|
},
|
|
{
|
|
ID: "HP101", NameDE: "KI-Bilderkennung — Software", NameEN: "Vision Ai — software",
|
|
RequiredComponentTags: []string{"has_ai", "sensor_part"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"sensor_fault"},
|
|
SuggestedMeasureIDs: []string{"M214", "M119", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E15"},
|
|
Priority: 70,
|
|
// Source: R077, R331, R588, R1088
|
|
},
|
|
{
|
|
ID: "HP102", NameDE: "Vision-Kamera — elektrisch", NameEN: "Vision Camera — electrical",
|
|
RequiredComponentTags: []string{"sensor_part"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"ai_misclassification"},
|
|
SuggestedMeasureIDs: []string{"M133", "M227", "M141"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 75,
|
|
// Source: R584, R1084
|
|
},
|
|
}
|
|
}
|