fix(iace): close domain-gate gaps — generic patterns with press/welding/glass text
CI / loc-budget (push) Successful in 15s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / detect-changes (push) Successful in 6s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / build-sha-integrity (push) Failing after 4s
CI / validate-canonical-controls (push) Successful in 12s
CI / nodejs-build (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go (push) Failing after 37s
CI / iace-gt-coverage (push) Successful in 23s
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped

Observed on a real Kistenhubgeraet (lift) project: generic mechanical patterns
(e.g. HP1000 "Quetschen Arm zwischen Pressenteilen") carry NO machine type and
only generic tags (crush_point, rotating_part), so they fired for a lift; the
narrow domain-gate terms missed their press/welding/glass wording.

Broadens domainGateTerms (pressenteil, pressraum, blechbearbeitung,
punktschweiss, schweisselektrod, elektrodenspalt) and adds a dom_glass domain
(glasschneid/glasbearbeitung/...) with its emit keywords. New test pins that the
four observed leakers now require a dom_* tag. Ghost=0, Leakage=0, coverage held
on both GTs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-06-09 16:08:02 +02:00
parent c6ebe61162
commit 7b3a6f0dcd
3 changed files with 49 additions and 1 deletions
@@ -68,6 +68,7 @@ func GetKeywordDictionary() []KeywordEntry {
{Keywords: []string{"drehmaschine", "fraesmaschine", "zerspanung"}, ExtraTags: []string{"dom_cnc"}},
{Keywords: []string{"maehdrescher", "ballenpresse", "feldhaecksler", "traktor"}, ExtraTags: []string{"dom_agri"}},
{Keywords: []string{"rolltreppe", "fahrtreppe", "fahrsteig"}, ExtraTags: []string{"dom_escalator"}},
{Keywords: []string{"glasschneid", "glasbearbeitung", "flachglas", "glasscheibe", "glaskante", "glasmaschine"}, ExtraTags: []string{"dom_glass"}},
// Ghost-Closure (Emit-Seite): macht die 34 toten Required-Tags
// emittierbar, jeweils NUR via domaenenspezifische Keywords -> die 120
// Ghost-Patterns feuern wieder, aber nur fuer ihre echte Maschine (kein
@@ -27,6 +27,11 @@ var domainGateTerms = map[string]string{
"stanzhub": "dom_press", "pressenhub": "dom_press", "pressenstoessel": "dom_press",
"dauerhub": "dom_press", "exzenterpresse": "dom_press", "beinpresse": "dom_press",
"stanzpresse": "dom_press", "umformpresse": "dom_press",
"pressenteil": "dom_press", "pressraum": "dom_press", "blechbearbeitung": "dom_press",
"werkzeugraum der presse": "dom_press",
// Glas-Bearbeitung
"glasschneid": "dom_glass", "glasbearbeitung": "dom_glass", "glasscheibe": "dom_glass",
"glaskante": "dom_glass",
// Kunststoff / Spritzguss / Extrusion
"spritzgie": "dom_plastics", "extruder": "dom_plastics", "extrusion": "dom_plastics",
"kunststoffschmelze": "dom_plastics", "schliesseinheit": "dom_plastics",
@@ -39,7 +44,8 @@ var domainGateTerms = map[string]string{
"schleifscheibe": "dom_grinding", "schleifbock": "dom_grinding",
// Schweissen
"widerstandsschweiss": "dom_welding", "lichtbogenschweiss": "dom_welding",
"schutzgasschweiss": "dom_welding",
"schutzgasschweiss": "dom_welding", "punktschweiss": "dom_welding",
"schweisselektrod": "dom_welding", "elektrodenspalt": "dom_welding",
// Solar / PV
"pv-modul": "dom_solar", "photovoltaik": "dom_solar", "pv-anlage": "dom_solar",
"dc-steckverbindung": "dom_solar", "solarmodul": "dom_solar",
@@ -0,0 +1,41 @@
package iace
import (
"strings"
"testing"
)
// TestDomainGate_NamedLeakersGated pins the concrete cross-domain leakers that
// were observed firing for a Kistenhubgeraet (lift) project: generic patterns
// whose text names a press/welding/glass machine but which carry no machine
// type and only generic tags. After applyDomainGates they MUST require a dom_*
// tag, so they no longer fire for unrelated machines.
func TestDomainGate_NamedLeakersGated(t *testing.T) {
leakers := []string{
"Quetschen Arm zwischen Pressenteilen",
"Quetschen durch Punktschweisselektroden",
"Laerm bei Glasschneidemaschine",
"Laerm bei Blechbearbeitung (Stanzen)",
}
byName := map[string]HazardPattern{}
for _, p := range collectAllPatterns() {
byName[p.NameDE] = p
}
for _, n := range leakers {
p, ok := byName[n]
if !ok {
t.Errorf("leaker pattern %q not found in library", n)
continue
}
hasDom := false
for _, tag := range p.RequiredComponentTags {
if strings.HasPrefix(tag, "dom_") {
hasDom = true
break
}
}
if !hasDom {
t.Errorf("%s (%q) not domain-gated; RequiredComponentTags=%v", p.ID, n, p.RequiredComponentTags)
}
}
}