feat(pipeline): implement golden test suite + fix ontology patterns

- Add test_golden_controls.py: 37 tests covering all 8 YAML categories
  (container, framework, evidence, negative, title, split, scope, merge_key)
- Fix evidence detection: handle German feminine articles (eine/einer/etc.)
- Fix framework detection: use verb stems for conjugated German verbs
- Add framework patterns: OWASP API6, CCM without CSA prefix, generic category
- Fix negative patterns: use "nicht übertragen/gespeichert/erscheinen" before
  generic "dürfen nicht" to correctly route prevent vs exclude

All 73 tests passing (36 ontology + 37 golden).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-26 09:48:12 +02:00
parent d1f3b9ffcd
commit d660a45bb5
3 changed files with 259 additions and 11 deletions

View File

@@ -116,7 +116,7 @@ class TestClassifyObligation:
def test_negative_obligation(self):
result = classify_obligation("Sensible Daten dürfen nicht in URLs übertragen werden")
assert result["routing"] == "atomic"
assert result["action_type"] == "exclude"
assert result["action_type"] == "prevent"
class TestBuildCanonicalKey: