diff --git a/ai-compliance-sdk/internal/iace/hazard_blocks.go b/ai-compliance-sdk/internal/iace/hazard_blocks.go index 1047573..20c0cef 100644 --- a/ai-compliance-sdk/internal/iace/hazard_blocks.go +++ b/ai-compliance-sdk/internal/iace/hazard_blocks.go @@ -2,7 +2,6 @@ package iace import ( "sort" - "strings" "github.com/google/uuid" ) @@ -108,22 +107,10 @@ func ComputeHazardBlocks( } func buildBlockKey(h Hazard) string { - comp := h.ComponentID.String() - zone := NormalizeDEPublic(h.HazardousZone) - // Use first 3 significant words of zone for grouping - words := strings.Fields(zone) - var sig []string - for _, w := range words { - w = strings.Trim(w, ".,;:!?()/-") - if len(w) >= 4 { - sig = append(sig, w) - } - if len(sig) >= 2 { - break - } - } - zoneKey := strings.Join(sig, "_") - return h.Category + ":" + comp + ":" + zoneKey + // Group by category + component. Hazards at the same component in the + // same category form one block — the zone is typically different but the + // protective measures (e.g. Schutzzaun, Sicherheitszuhaltung) are shared. + return h.Category + ":" + h.ComponentID.String() } func sortByRiskDesc(entries []HazardBlockEntry, assessMap map[uuid.UUID]*RiskAssessment) {