Split 4 oversized files (503-679 LOC each) into focused units all under 500 LOC: - tech_file_generator.go → +_prompts, +_prompt_builder, +_fallback - hazard_patterns_extended.go → +_extended2.go (HP074-HP102 extracted) - models.go → +_entities.go, +_api.go (enums / DB entities / API types) - completeness.go → +_gates.go (gate definitions extracted) All files remain in package iace. Zero behavior changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
335 lines
14 KiB
Go
335 lines
14 KiB
Go
package iace
|
|
|
|
// GetExtendedHazardPatterns returns 58 additional patterns
|
|
// derived from the Rule Library documents (R051-R1550).
|
|
// These supplement the 44 built-in patterns in hazard_patterns.go.
|
|
// Patterns HP045-HP073 are defined here; HP074-HP102 in hazard_patterns_extended2.go.
|
|
func GetExtendedHazardPatterns() []HazardPattern {
|
|
return append(getExtendedHazardPatternsA(), getExtendedHazardPatternsB()...)
|
|
}
|
|
|
|
// getExtendedHazardPatternsA returns patterns HP045-HP073.
|
|
func getExtendedHazardPatternsA() []HazardPattern {
|
|
return []HazardPattern{
|
|
{
|
|
ID: "HP045", NameDE: "Aktor — elektrisch", NameEN: "Actuator — electrical",
|
|
RequiredComponentTags: []string{"actuator_part"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"maintenance"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M121"},
|
|
SuggestedEvidenceIDs: []string{"E21"},
|
|
Priority: 80,
|
|
// Source: R341
|
|
},
|
|
{
|
|
ID: "HP046", NameDE: "Aktor — mechanisch", NameEN: "Actuator — mechanical",
|
|
RequiredComponentTags: []string{"actuator_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M106"},
|
|
SuggestedEvidenceIDs: []string{"E08"},
|
|
Priority: 80,
|
|
// Source: R340
|
|
},
|
|
{
|
|
ID: "HP047", NameDE: "KI-Steuerung — Software", NameEN: "Ai Controller — software",
|
|
RequiredComponentTags: []string{"has_ai", "has_software", "programmable"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"ai_misclassification"},
|
|
SuggestedMeasureIDs: []string{"M103"},
|
|
SuggestedEvidenceIDs: []string{"E15"},
|
|
Priority: 75,
|
|
// Source: R590, R1090
|
|
},
|
|
{
|
|
ID: "HP048", NameDE: "Kabelbaum — elektrisch", NameEN: "Cable Harness — electrical",
|
|
RequiredComponentTags: []string{"electrical_part"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"installation", "operation"},
|
|
GeneratedHazardCats: []string{"electrical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M062"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 80,
|
|
// Source: R065, R570, R1070
|
|
},
|
|
{
|
|
ID: "HP049", NameDE: "Kabelsystem — elektrisch", NameEN: "Cable System — electrical",
|
|
RequiredComponentTags: []string{"electrical_part"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"installation", "operation"},
|
|
GeneratedHazardCats: []string{"electrical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M062"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 80,
|
|
// Source: R317, R318
|
|
},
|
|
{
|
|
ID: "HP050", NameDE: "Kamerasystem — elektrisch", NameEN: "Camera System — electrical",
|
|
RequiredComponentTags: []string{"sensor_part"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"ai_misclassification"},
|
|
SuggestedMeasureIDs: []string{"M082"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 75,
|
|
// Source: R074, R328
|
|
},
|
|
{
|
|
ID: "HP051", NameDE: "Druckluftleitung — pneumatisch", NameEN: "Compressed Air 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: R070
|
|
},
|
|
{
|
|
ID: "HP052", NameDE: "Kompressor — pneumatisch", NameEN: "Compressor — pneumatic",
|
|
RequiredComponentTags: []string{"high_pressure", "noise_source", "pneumatic_part"},
|
|
RequiredEnergyTags: []string{"pneumatic_pressure"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"pneumatic_hydraulic"},
|
|
SuggestedMeasureIDs: []string{"M022"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 70,
|
|
// Source: R578, R1078
|
|
},
|
|
{
|
|
ID: "HP053", NameDE: "Schaltschrank — elektrisch", NameEN: "Control Cabinet — electrical",
|
|
RequiredComponentTags: []string{"electrical_part", "high_voltage"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"maintenance", "operation"},
|
|
GeneratedHazardCats: []string{"electrical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M061", "M063", "M121"},
|
|
SuggestedEvidenceIDs: []string{"E10", "E20"},
|
|
Priority: 80,
|
|
// Source: R061, R062, R315, R316, R566, R567, R1066, R1067
|
|
},
|
|
{
|
|
ID: "HP054", NameDE: "Steuerungsschnittstelle — Software", NameEN: "Control Interface — software",
|
|
RequiredComponentTags: []string{"has_software", "user_interface"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"software_fault"},
|
|
SuggestedMeasureIDs: []string{"M101", "M113"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 70,
|
|
// Source: R080, R334
|
|
},
|
|
{
|
|
ID: "HP055", NameDE: "Steuerung — elektrisch", NameEN: "Controller — electrical",
|
|
RequiredComponentTags: []string{"has_software", "programmable"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"restart"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M106"},
|
|
SuggestedEvidenceIDs: []string{"E08"},
|
|
Priority: 80,
|
|
// Source: R339, R598, R1098
|
|
},
|
|
{
|
|
ID: "HP056", NameDE: "Foerderband — mechanisch", NameEN: "Conveyor Belt — mechanical",
|
|
RequiredComponentTags: []string{"entanglement_risk", "moving_part", "rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"automatic_operation", "cleaning", "operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M051", "M054", "M121"},
|
|
SuggestedEvidenceIDs: []string{"E20", "E21"},
|
|
Priority: 80,
|
|
// Source: R053, R054, R556, R557, R1056, R1057
|
|
},
|
|
{
|
|
ID: "HP057", NameDE: "Foerdersystem — mechanisch", NameEN: "Conveyor System — mechanical",
|
|
RequiredComponentTags: []string{"entanglement_risk", "moving_part", "rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"cleaning", "operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M051", "M054", "M121"},
|
|
SuggestedEvidenceIDs: []string{"E20", "E21"},
|
|
Priority: 80,
|
|
// Source: R305, R306
|
|
},
|
|
{
|
|
ID: "HP058", NameDE: "Kuehlgeraet — thermisch", NameEN: "Cooling Unit — thermal",
|
|
RequiredComponentTags: []string{"high_temperature"},
|
|
RequiredEnergyTags: []string{"thermal"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"thermal_hazard"},
|
|
SuggestedMeasureIDs: []string{"M022"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 70,
|
|
// Source: R581, R1081
|
|
},
|
|
{
|
|
ID: "HP059", NameDE: "Kupplung — mechanisch", NameEN: "Coupling — mechanical",
|
|
RequiredComponentTags: []string{"rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M012"},
|
|
SuggestedEvidenceIDs: []string{"E08"},
|
|
Priority: 80,
|
|
// Source: R056, R564, R1064
|
|
},
|
|
{
|
|
ID: "HP060", NameDE: "Diagnosemodul — Software", NameEN: "Diagnostic Module — software",
|
|
RequiredComponentTags: []string{"has_software", "safety_device"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"software_fault"},
|
|
SuggestedMeasureIDs: []string{"M103"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 70,
|
|
// Source: R596, R1096
|
|
},
|
|
{
|
|
ID: "HP061", NameDE: "Firewall — Software", NameEN: "Firewall — software",
|
|
RequiredComponentTags: []string{"networked", "security_device"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"unauthorized_access"},
|
|
SuggestedMeasureIDs: []string{"M116"},
|
|
SuggestedEvidenceIDs: []string{"E16"},
|
|
Priority: 85,
|
|
// Source: R587, R1087
|
|
},
|
|
{
|
|
ID: "HP062", NameDE: "Firmware — Software", NameEN: "Firmware — software",
|
|
RequiredComponentTags: []string{"has_software", "programmable"},
|
|
RequiredEnergyTags: []string{},
|
|
RequiredLifecycles: []string{"software_update"},
|
|
GeneratedHazardCats: []string{"update_failure"},
|
|
SuggestedMeasureIDs: []string{"M104"},
|
|
SuggestedEvidenceIDs: []string{"E18"},
|
|
Priority: 70,
|
|
// Source: R338, R597, R1097
|
|
},
|
|
{
|
|
ID: "HP063", NameDE: "Ofen — thermisch", NameEN: "Furnace — thermal",
|
|
RequiredComponentTags: []string{"high_temperature"},
|
|
RequiredEnergyTags: []string{"thermal"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"thermal_hazard"},
|
|
SuggestedMeasureIDs: []string{"M015"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 70,
|
|
// Source: R326, R580, R1080
|
|
},
|
|
{
|
|
ID: "HP064", NameDE: "Ofenkammer — thermisch", NameEN: "Furnace Chamber — thermal",
|
|
RequiredComponentTags: []string{"high_temperature"},
|
|
RequiredEnergyTags: []string{"thermal"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"thermal_hazard"},
|
|
SuggestedMeasureIDs: []string{"M015"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 70,
|
|
// Source: R072
|
|
},
|
|
{
|
|
ID: "HP065", NameDE: "Getriebe — mechanisch", NameEN: "Gearbox — mechanical",
|
|
RequiredComponentTags: []string{"pinch_point", "rotating_part"},
|
|
RequiredEnergyTags: []string{"kinetic"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M004"},
|
|
SuggestedEvidenceIDs: []string{"E08"},
|
|
Priority: 80,
|
|
// Source: R055, R563, R1063
|
|
},
|
|
{
|
|
ID: "HP066", NameDE: "Heizelement — thermisch", NameEN: "Heating Element — thermal",
|
|
RequiredComponentTags: []string{"high_temperature"},
|
|
RequiredEnergyTags: []string{"thermal"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"thermal_hazard"},
|
|
SuggestedMeasureIDs: []string{"M015"},
|
|
SuggestedEvidenceIDs: []string{"E10"},
|
|
Priority: 70,
|
|
// Source: R071, R325, R579, R1079
|
|
},
|
|
{
|
|
ID: "HP067", NameDE: "HMI-Bedienterminal — elektrisch", NameEN: "Hmi — electrical",
|
|
RequiredComponentTags: []string{"has_software", "user_interface"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"hmi_error"},
|
|
SuggestedMeasureIDs: []string{"M131"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 70,
|
|
// Source: R333
|
|
},
|
|
{
|
|
ID: "HP068", NameDE: "HMI-Panel — elektrisch", NameEN: "Hmi Panel — electrical",
|
|
RequiredComponentTags: []string{"has_software", "user_interface"},
|
|
RequiredEnergyTags: []string{"electrical_energy"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"hmi_error"},
|
|
SuggestedMeasureIDs: []string{"M131"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 70,
|
|
// Source: R079, R591, R1091
|
|
},
|
|
{
|
|
ID: "HP069", NameDE: "Hydraulikzylinder — hydraulisch", NameEN: "Hydraulic Cylinder — hydraulic",
|
|
RequiredComponentTags: []string{"high_force", "high_pressure", "hydraulic_part", "moving_part"},
|
|
RequiredEnergyTags: []string{"hydraulic_pressure"},
|
|
RequiredLifecycles: []string{"maintenance", "operation"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M021", "M022"},
|
|
SuggestedEvidenceIDs: []string{"E08", "E11", "E20"},
|
|
Priority: 80,
|
|
// Source: R066, R319, R320, R572, R1072
|
|
},
|
|
{
|
|
ID: "HP070", NameDE: "Hydraulikschlauch — hydraulisch", NameEN: "Hydraulic Hose — hydraulic",
|
|
RequiredComponentTags: []string{"high_pressure", "hydraulic_part"},
|
|
RequiredEnergyTags: []string{"hydraulic_pressure"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"pneumatic_hydraulic"},
|
|
SuggestedMeasureIDs: []string{"M051"},
|
|
SuggestedEvidenceIDs: []string{"E11"},
|
|
Priority: 70,
|
|
// Source: R067, R321, R573, R1073
|
|
},
|
|
{
|
|
ID: "HP071", NameDE: "Hydraulikpumpe — hydraulisch", NameEN: "Hydraulic Pump — hydraulic",
|
|
RequiredComponentTags: []string{"high_pressure", "hydraulic_part"},
|
|
RequiredEnergyTags: []string{"hydraulic_pressure"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"pneumatic_hydraulic"},
|
|
SuggestedMeasureIDs: []string{"M021", "M022"},
|
|
SuggestedEvidenceIDs: []string{"E11", "E14"},
|
|
Priority: 70,
|
|
// Source: R068, R322, R571, R1071
|
|
},
|
|
{
|
|
ID: "HP072", NameDE: "Hydrauliksystem — hydraulisch", NameEN: "Hydraulic System — hydraulic",
|
|
RequiredComponentTags: []string{"high_pressure", "hydraulic_part"},
|
|
RequiredEnergyTags: []string{"hydraulic_pressure"},
|
|
RequiredLifecycles: []string{"maintenance"},
|
|
GeneratedHazardCats: []string{"mechanical_hazard"},
|
|
SuggestedMeasureIDs: []string{"M021"},
|
|
SuggestedEvidenceIDs: []string{"E20"},
|
|
Priority: 80,
|
|
// Source: R575, R1075
|
|
},
|
|
{
|
|
ID: "HP073", NameDE: "Hydraulikventil — hydraulisch", NameEN: "Hydraulic Valve — hydraulic",
|
|
RequiredComponentTags: []string{"high_pressure", "hydraulic_part"},
|
|
RequiredEnergyTags: []string{"hydraulic_pressure"},
|
|
RequiredLifecycles: []string{"operation"},
|
|
GeneratedHazardCats: []string{"pneumatic_hydraulic"},
|
|
SuggestedMeasureIDs: []string{"M022"},
|
|
SuggestedEvidenceIDs: []string{"E14"},
|
|
Priority: 70,
|
|
// Source: R574, R1074
|
|
},
|
|
}
|
|
}
|