From bde6e76a57722a5da9f59a492b0e2fed54f9dc9a Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Wed, 24 Jun 2026 23:01:19 +0200 Subject: [PATCH] =?UTF-8?q?fix(ai-sdk):=20keyword=20precision=20=E2=80=94?= =?UTF-8?q?=20stop=20adjective/generic=20ghost=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Class D (generic keyword hygiene, GT-guarded). Two over-broad keyword->component mappings produced ghost components: - "kuehl"/"cool" -> Kuehlaggregat (C095) matched product variants ("Cool-Ausfuehrung") and outputs ("kuehle Glaeser"). Narrowed to cooling-UNIT terms (kuehlaggregat, kuehlanlage, kuehler, kaeltemaschine, chiller, rueckkuehl). - "filter" -> Absauganlage/Oelnebelabscheider (C124) matched any filter (Laugen-/Wasser-/Oelfilter). Keep "filteranlage" only. No pattern or GT test depends on these mappings (Kistenhub/Bremse use hand-crafted inputs). UC-M now parses 6 plausible components (was 8 incl. the two ghosts). Warewashing GT recall 82.4% and Kistenhub/Bremse pins unchanged. Co-Authored-By: Claude Opus 4.7 --- .../internal/iace/gt_warewashing_test.go | 11 +++++++++++ ai-compliance-sdk/internal/iace/keyword_dictionary.go | 9 +++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ai-compliance-sdk/internal/iace/gt_warewashing_test.go b/ai-compliance-sdk/internal/iace/gt_warewashing_test.go index 456619c7..1d0a6552 100644 --- a/ai-compliance-sdk/internal/iace/gt_warewashing_test.go +++ b/ai-compliance-sdk/internal/iace/gt_warewashing_test.go @@ -103,6 +103,17 @@ func TestWarewashing_GTCoverage(t *testing.T) { t.Fatalf("parse GT: %v", err) } + { + res := ParseNarrative(warewashingNarrative, "Gewerbliche Untertisch-Geschirrspuelmaschine (vernetzt)") + var cn []string + for _, c := range res.Components { + if !c.Negated { + cn = append(cn, c.NameDE) + } + } + t.Logf("Parsed components: %v", cn) + } + hazards, mitigations, nPatterns := warewashingEngineOutput() t.Logf("Engine: %d patterns kept (relevance+cyber filter) -> %d hazards", nPatterns, len(hazards)) diff --git a/ai-compliance-sdk/internal/iace/keyword_dictionary.go b/ai-compliance-sdk/internal/iace/keyword_dictionary.go index abea20ea..001561e7 100644 --- a/ai-compliance-sdk/internal/iace/keyword_dictionary.go +++ b/ai-compliance-sdk/internal/iace/keyword_dictionary.go @@ -219,7 +219,9 @@ func GetKeywordDictionary() []KeywordEntry { // ── Absaugung / Umwelt ────────────────────────────────────────── {Keywords: []string{"absaug", "extraction", "abscheider"}, ComponentIDs: []string{"C124"}, ExtraTags: []string{"noise_source"}}, - {Keywords: []string{"filter", "filteranlage"}, ComponentIDs: []string{"C124"}, ExtraTags: []string{}}, + // "filteranlage" only — bare "filter" falsely mapped any filter (Laugen-, + // Wasser-, Oel-, Netzfilter) to the oil-mist extractor C124. + {Keywords: []string{"filteranlage"}, ComponentIDs: []string{"C124"}, ExtraTags: []string{}}, // ── IT / Netzwerk ─────────────────────────────────────────────── {Keywords: []string{"switch", "netzwerk"}, ComponentIDs: []string{"C111"}, ExtraTags: []string{"networked"}}, @@ -248,7 +250,10 @@ func GetKeywordDictionary() []KeywordEntry { {Keywords: []string{"biege", "bend"}, ComponentIDs: []string{"C019"}, ExtraTags: []string{"high_force"}}, {Keywords: []string{"stanz", "stamp", "punch"}, ComponentIDs: []string{"C018"}, ExtraTags: []string{"high_force", "crush_point"}}, {Keywords: []string{"heiz", "heater", "heating"}, ComponentIDs: []string{"C094"}, EnergyIDs: []string{"EN06"}, ExtraTags: []string{"high_temperature"}}, - {Keywords: []string{"kuehl", "cool"}, ComponentIDs: []string{"C095"}, ExtraTags: []string{}}, + // Cooling UNIT only — not the bare adjectives "kuehl"/"cool", which falsely + // matched product-variant names ("Cool-Ausfuehrung") and outputs ("kuehle + // Glaeser"). Keyword->component must name an actual component. + {Keywords: []string{"kuehlaggregat", "kuehlanlage", "kuehler", "kaeltemaschine", "chiller", "rueckkuehl"}, ComponentIDs: []string{"C095"}, ExtraTags: []string{}}, {Keywords: []string{"luefter", "fan", "geblaese"}, ComponentIDs: []string{"C096"}, ExtraTags: []string{"rotating_part", "noise_source"}}, {Keywords: []string{"spannvorrichtung", "fixture", "clamp"}, ComponentIDs: []string{"C100"}, ExtraTags: []string{"clamping_part"}},