fix(iace): scan ZoneDE in domain gate (catches zone-only domain hints)
CI / detect-changes (push) Successful in 6s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Has been skipped
CI / test-go (push) Failing after 37s
CI / iace-gt-coverage (push) Successful in 23s
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 11s
CI / loc-budget (push) Successful in 14s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / test-python-backend (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
CI / test-python-document-crawler (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 / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Has been skipped
CI / test-go (push) Failing after 37s
CI / iace-gt-coverage (push) Successful in 23s
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 11s
CI / loc-budget (push) Successful in 14s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / test-python-backend (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
A "Splitterflug bei Werkzeugbruch" pattern leaked into a lift re-seed because
its press hint ("Pressraum") lives in ZoneDE, which applyDomainGates did not
scan. Add ZoneDE to the gated text. Leakage stays 0, ghosts 0, coverage held.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -65,7 +65,7 @@ var domainGateTerms = map[string]string{
|
|||||||
func applyDomainGates(patterns []HazardPattern) []HazardPattern {
|
func applyDomainGates(patterns []HazardPattern) []HazardPattern {
|
||||||
for i := range patterns {
|
for i := range patterns {
|
||||||
text := normalizeGateText(patterns[i].NameDE + " " + patterns[i].ScenarioDE + " " +
|
text := normalizeGateText(patterns[i].NameDE + " " + patterns[i].ScenarioDE + " " +
|
||||||
patterns[i].TriggerDE + " " + patterns[i].HarmDE)
|
patterns[i].TriggerDE + " " + patterns[i].HarmDE + " " + patterns[i].ZoneDE)
|
||||||
|
|
||||||
present := make(map[string]bool, len(patterns[i].RequiredComponentTags))
|
present := make(map[string]bool, len(patterns[i].RequiredComponentTags))
|
||||||
for _, t := range patterns[i].RequiredComponentTags {
|
for _, t := range patterns[i].RequiredComponentTags {
|
||||||
|
|||||||
@@ -11,22 +11,23 @@ import (
|
|||||||
// type and only generic tags. After applyDomainGates they MUST require a dom_*
|
// type and only generic tags. After applyDomainGates they MUST require a dom_*
|
||||||
// tag, so they no longer fire for unrelated machines.
|
// tag, so they no longer fire for unrelated machines.
|
||||||
func TestDomainGate_NamedLeakersGated(t *testing.T) {
|
func TestDomainGate_NamedLeakersGated(t *testing.T) {
|
||||||
leakers := []string{
|
// Confirmed cross-domain leakers observed firing for a lift project. (Note:
|
||||||
"Quetschen Arm zwischen Pressenteilen",
|
// "Splitterflug bei Werkzeugbruch" has two patterns sharing the name; the
|
||||||
"Quetschen durch Punktschweisselektroden",
|
// one that leaked carries a "Pressraum" zone and is gated via the zone
|
||||||
"Laerm bei Glasschneidemaschine",
|
// scan — verified empirically by the project re-seed, not pinned here to
|
||||||
"Laerm bei Blechbearbeitung (Stanzen)",
|
// avoid catching the unrelated high-pressure plastics variant HP514.)
|
||||||
|
leakers := map[string]bool{
|
||||||
|
"Quetschen Arm zwischen Pressenteilen": true,
|
||||||
|
"Quetschen durch Punktschweisselektroden": true,
|
||||||
|
"Laerm bei Glasschneidemaschine": true,
|
||||||
|
"Laerm bei Blechbearbeitung (Stanzen)": true,
|
||||||
}
|
}
|
||||||
byName := map[string]HazardPattern{}
|
seen := map[string]bool{}
|
||||||
for _, p := range collectAllPatterns() {
|
for _, p := range collectAllPatterns() {
|
||||||
byName[p.NameDE] = p
|
if !leakers[p.NameDE] {
|
||||||
}
|
|
||||||
for _, n := range leakers {
|
|
||||||
p, ok := byName[n]
|
|
||||||
if !ok {
|
|
||||||
t.Errorf("leaker pattern %q not found in library", n)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
seen[p.NameDE] = true
|
||||||
hasDom := false
|
hasDom := false
|
||||||
for _, tag := range p.RequiredComponentTags {
|
for _, tag := range p.RequiredComponentTags {
|
||||||
if strings.HasPrefix(tag, "dom_") {
|
if strings.HasPrefix(tag, "dom_") {
|
||||||
@@ -35,7 +36,12 @@ func TestDomainGate_NamedLeakersGated(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !hasDom {
|
if !hasDom {
|
||||||
t.Errorf("%s (%q) not domain-gated; RequiredComponentTags=%v", p.ID, n, p.RequiredComponentTags)
|
t.Errorf("%s (%q) not domain-gated; RequiredComponentTags=%v", p.ID, p.NameDE, p.RequiredComponentTags)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for n := range leakers {
|
||||||
|
if !seen[n] {
|
||||||
|
t.Errorf("leaker pattern %q not found in library", n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user