feat(iace): add hazard-matching-engine with component library, tag system, and pattern engine
All checks were successful
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 44s
CI/CD / test-python-backend-compliance (push) Successful in 33s
CI/CD / test-python-document-crawler (push) Successful in 22s
CI/CD / test-python-dsms-gateway (push) Successful in 19s
CI/CD / validate-canonical-controls (push) Successful in 13s
CI/CD / Deploy (push) Successful in 4s

Implements Phases 1-4 of the IACE Hazard-Matching-Engine:
- 120 machine components (C001-C120) in 11 categories
- 20 energy sources (EN01-EN20)
- ~85 tag taxonomy across 5 domains
- 44 hazard patterns with AND/NOT matching logic
- Pattern engine with tag resolution and confidence scoring
- 8 new API endpoints (component-library, energy-sources, tags, patterns, match/apply)
- Completeness gate G09 for pattern matching
- 320 tests passing (36 new)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-16 08:50:11 +01:00
parent c7651796c9
commit 3b2006ebce
21 changed files with 4993 additions and 41 deletions

View File

@@ -608,10 +608,10 @@ func TestCompletenessCheck_GateCountsAndCategories(t *testing.T) {
}
result := checker.Check(ctx)
// The buildGateDefinitions function returns exactly 21 gates
// (G01-G08: 8, G10-G13: 4, G20-G24: 5, G30: 1, G40-G42: 3 = 21 total)
if len(result.Gates) != 21 {
t.Errorf("Total gates = %d, want 21", len(result.Gates))
// The buildGateDefinitions function returns exactly 22 gates
// (G01-G08: 8, G09: 1, G10-G13: 4, G20-G24: 5, G30: 1, G40-G42: 3 = 22 total)
if len(result.Gates) != 22 {
t.Errorf("Total gates = %d, want 22", len(result.Gates))
}
// Count required vs recommended
@@ -622,8 +622,8 @@ func TestCompletenessCheck_GateCountsAndCategories(t *testing.T) {
requiredCount++
}
}
// G30 is the only recommended gate (Required=false, Recommended=true)
// All others are required (20 required, 1 recommended)
// G09 and G30 are recommended gates (Required=false, Recommended=true)
// All others are required (20 required, 2 recommended)
if requiredCount != 20 {
t.Errorf("Required gates count = %d, want 20", requiredCount)
}
@@ -632,9 +632,9 @@ func TestCompletenessCheck_GateCountsAndCategories(t *testing.T) {
t.Errorf("TotalRequired = %d, want 20", result.TotalRequired)
}
// TotalRecommended should be 1 (G30)
if result.TotalRecommended != 1 {
t.Errorf("TotalRecommended = %d, want 1", result.TotalRecommended)
// TotalRecommended should be 2 (G09, G30)
if result.TotalRecommended != 2 {
t.Errorf("TotalRecommended = %d, want 2", result.TotalRecommended)
}
_ = recommendedCount
@@ -645,7 +645,7 @@ func TestCompletenessCheck_GateCountsAndCategories(t *testing.T) {
}
expectedCategories := map[string]int{
"onboarding": 8,
"onboarding": 9, // G01-G08 + G09 (recommended)
"classification": 4,
"hazard_risk": 5,
"evidence": 1,