feat(iace): integrate Rule Library as 58 extended hazard patterns (HP045-HP102)
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 39s
CI/CD / test-python-backend-compliance (push) Successful in 38s
CI/CD / test-python-document-crawler (push) Successful in 25s
CI/CD / test-python-dsms-gateway (push) Successful in 20s
CI/CD / validate-canonical-controls (push) Successful in 14s
CI/CD / Deploy (push) Successful in 2s
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 39s
CI/CD / test-python-backend-compliance (push) Successful in 38s
CI/CD / test-python-document-crawler (push) Successful in 25s
CI/CD / test-python-dsms-gateway (push) Successful in 20s
CI/CD / validate-canonical-controls (push) Successful in 14s
CI/CD / Deploy (push) Successful in 2s
Parsed 171 explicit rules from 4 Rule Library Word documents (R051-R1550), deduplicated into 58 unique (component, energy_source) patterns, and mapped to existing IACE IDs (component tags, M-IDs, E-IDs). Changes: - hazard_patterns_extended.go: 58 new patterns derived from Rule Library - pattern_engine.go: combines builtin (44) + extended (58) = 102 total patterns - iace_handler.go: ListHazardPatterns returns all 102 patterns - iace.md: updated documentation for 102 patterns - scripts/generate-rule-patterns.py: mapping + Go code generator - scripts/parsed-rule-library.json: extracted rule data Tests: 132 passing (9 new extended pattern tests) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,11 +52,14 @@ type PatternEngine struct {
|
||||
patterns []HazardPattern
|
||||
}
|
||||
|
||||
// NewPatternEngine creates a PatternEngine with built-in patterns and resolver.
|
||||
// NewPatternEngine creates a PatternEngine with built-in + extended patterns and resolver.
|
||||
func NewPatternEngine() *PatternEngine {
|
||||
// Combine built-in (HP001-HP044) and extended (HP045+) patterns
|
||||
patterns := GetBuiltinHazardPatterns()
|
||||
patterns = append(patterns, GetExtendedHazardPatterns()...)
|
||||
return &PatternEngine{
|
||||
resolver: NewTagResolver(),
|
||||
patterns: GetBuiltinHazardPatterns(),
|
||||
patterns: patterns,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user