feat(iace): Einsatzbereich / Branche — filtert branchenspezifische Patterns
Build + Deploy / build-admin-compliance (push) Successful in 2m7s
Build + Deploy / build-backend-compliance (push) Successful in 13s
Build + Deploy / build-ai-sdk (push) Successful in 55s
Build + Deploy / build-developer-portal (push) Successful in 12s
Build + Deploy / build-tts (push) Successful in 34s
Build + Deploy / build-document-crawler (push) Successful in 12s
Build + Deploy / build-dsms-gateway (push) Successful in 13s
Build + Deploy / build-dsms-node (push) Successful in 14s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / loc-budget (push) Failing after 18s
CI / secret-scan (push) Has been skipped
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Successful in 3m5s
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / test-go (push) Successful in 46s
CI / test-python-backend (push) Successful in 37s
CI / test-python-document-crawler (push) Successful in 26s
CI / test-python-dsms-gateway (push) Successful in 22s
CI / validate-canonical-controls (push) Successful in 15s
Build + Deploy / trigger-orca (push) Successful in 2m19s
Build + Deploy / build-admin-compliance (push) Successful in 2m7s
Build + Deploy / build-backend-compliance (push) Successful in 13s
Build + Deploy / build-ai-sdk (push) Successful in 55s
Build + Deploy / build-developer-portal (push) Successful in 12s
Build + Deploy / build-tts (push) Successful in 34s
Build + Deploy / build-document-crawler (push) Successful in 12s
Build + Deploy / build-dsms-gateway (push) Successful in 13s
Build + Deploy / build-dsms-node (push) Successful in 14s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / loc-budget (push) Failing after 18s
CI / secret-scan (push) Has been skipped
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Successful in 3m5s
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / test-go (push) Successful in 46s
CI / test-python-backend (push) Successful in 37s
CI / test-python-document-crawler (push) Successful in 26s
CI / test-python-dsms-gateway (push) Successful in 22s
CI / validate-canonical-controls (push) Successful in 15s
Build + Deploy / trigger-orca (push) Successful in 2m19s
Neues Feld "Einsatzbereich" auf Interview-Seite (Sektion 7) mit 15 Branchen. Pattern Engine bekommt MachineTypes aus MatchInput → branchenfremde Patterns (Medizin, Aufzug, Bau etc.) feuern nur wenn die Branche ausgewählt ist. Refactoring: iace_handler_init.go aufgeteilt in init + init_helpers (LOC-Limit). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,10 @@ type MatchInput struct {
|
||||
// FailureModes are the active failure mode IDs relevant for this project.
|
||||
// Used to filter patterns that require specific failure modes.
|
||||
FailureModes []string `json:"failure_modes,omitempty"`
|
||||
// MachineTypes are the industry sectors / machine types for this project.
|
||||
// Patterns with MachineTypes filter only fire if at least one matches.
|
||||
// Empty = all patterns fire (backwards compatible).
|
||||
MachineTypes []string `json:"machine_types,omitempty"`
|
||||
}
|
||||
|
||||
// MatchOutput contains the results of pattern matching.
|
||||
@@ -317,6 +321,22 @@ func (e *PatternEngine) Match(input MatchInput) *MatchOutput {
|
||||
// patternMatches checks if a pattern fires given the resolved tag set, lifecycle phases,
|
||||
// operational states, and state transitions.
|
||||
func patternMatches(p HazardPattern, tagSet map[string]bool, input MatchInput) bool {
|
||||
// If pattern requires specific machine types, project must match at least one.
|
||||
// Patterns without MachineTypes fire for ALL projects (backwards compatible).
|
||||
if len(p.MachineTypes) > 0 && len(input.MachineTypes) > 0 {
|
||||
found := false
|
||||
mtSet := toSet(input.MachineTypes)
|
||||
for _, mt := range p.MachineTypes {
|
||||
if mtSet[mt] {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// All required component tags must be present (AND)
|
||||
for _, t := range p.RequiredComponentTags {
|
||||
if !tagSet[t] {
|
||||
|
||||
Reference in New Issue
Block a user