feat(ai-sdk): classify NIST/OWASP/Grundschutz as technical_standard (#37)
CI / detect-changes (push) Successful in 4s
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) Successful in 6s
CI / validate-canonical-controls (push) Successful in 3s
CI / loc-budget (push) Successful in 18s
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) Has been skipped
CI / test-go (push) Successful in 1m0s
CI / iace-gt-coverage (push) Successful in 14s
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
CI / detect-changes (push) Successful in 4s
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) Successful in 6s
CI / validate-canonical-controls (push) Successful in 3s
CI / loc-budget (push) Successful in 18s
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) Has been skipped
CI / test-go (push) Successful in 1m0s
CI / iace-gt-coverage (push) Successful in 14s
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
This commit was merged in pull request #37.
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
// authorityInfo is the normative classification of a search result, used internally
|
||||
// for re-ranking only (Phase 1 changes ordering, not the response contract).
|
||||
type authorityInfo struct {
|
||||
weight int // 100 binding_law, 70 guidance, 0 foreign_law, 50 unknown
|
||||
sourceClass string // binding_law | supervisory_guidance | foreign_law | unknown
|
||||
weight int // 100 binding, 80 technical_standard, 70 guidance, 0 foreign, 50 unknown
|
||||
sourceClass string // binding_law | technical_standard | supervisory_guidance | foreign_law | unknown
|
||||
jurisdiction string // DE | EU | CH
|
||||
}
|
||||
|
||||
@@ -18,7 +18,13 @@ var (
|
||||
guidanceMarkers = []string{
|
||||
"DSK", "EDPB", "BfDI", "BFDI", "BayLfD", "Baylfb", "ENISA", "BSI", "EUCC",
|
||||
"Standards Mapping", "Kpnr", "Orientierungshilfe", "Handreichung", "Beschluss",
|
||||
"Leitlinie", "Guidance", "Empfehlung", "NIST", "OECD", "CISA", "Blue Guide",
|
||||
"Leitlinie", "Guidance", "Empfehlung", "OECD", "CISA", "Blue Guide",
|
||||
}
|
||||
// Technical standards / control frameworks (best-practice controls). Checked BEFORE
|
||||
// guidanceMarkers so a "BSI Grundschutz" chunk classifies as a standard, not BSI guidance.
|
||||
standardMarkers = []string{
|
||||
"NIST", "OWASP", "Grundschutz", "ISO 27001", "ISO/IEC 27001",
|
||||
"CSA CCM", "Cloud Controls Matrix", "CIS Benchmark", "CIS Control",
|
||||
}
|
||||
foreignMarkers = []string{"RevDSG", "fedlex", "(CH)"}
|
||||
deMarkers = []string{"BDSG", "DSK", "BfDI", "BFDI", "BayLfD", "Baylfb", "BSI"}
|
||||
@@ -48,6 +54,8 @@ func classifyAuthority(r LegalSearchResult) authorityInfo {
|
||||
switch {
|
||||
case containsAny(hay, foreignMarkers):
|
||||
return authorityInfo{weight: 0, sourceClass: "foreign_law", jurisdiction: "CH"}
|
||||
case r.Category == "standard" || containsAny(hay, standardMarkers):
|
||||
return authorityInfo{weight: 80, sourceClass: "technical_standard", jurisdiction: jur}
|
||||
case r.Category == "guidance" || containsAny(hay, guidanceMarkers):
|
||||
return authorityInfo{weight: 70, sourceClass: "supervisory_guidance", jurisdiction: jur}
|
||||
case r.Category == "regulation" || r.Category == "eu_recht" || normPattern.MatchString(r.ArticleLabel):
|
||||
@@ -61,6 +69,8 @@ func sourceClassFromWeight(w int) string {
|
||||
switch {
|
||||
case w >= 100:
|
||||
return "binding_law"
|
||||
case w >= 80:
|
||||
return "technical_standard"
|
||||
case w >= 70:
|
||||
return "supervisory_guidance"
|
||||
case w <= 0:
|
||||
|
||||
Reference in New Issue
Block a user