docs: instruction for hardcoded knowledge → Control Library migration

6 files with hardcoded legal knowledge identified. Review deadline 2026-07-01.
legal_basis_validator.py marked with warning log on every use.
Instruction file for other session to execute migration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-29 16:33:48 +02:00
parent 85c4cbbf37
commit 2c9cea74e3
2 changed files with 127 additions and 2 deletions
@@ -2,7 +2,23 @@
Legal Basis Validator — checks if the correct DSGVO legal basis (lit. a-f)
is used for each processing purpose in the privacy policy.
Common mistakes:
⚠️ TECHNISCHE SCHULD / HARDCODED KNOWLEDGE:
Dieses Modul enthält hartkodierte Rechtsgrundlagen-Zuordnungen (CORRECT_BASIS dict).
Das ist ein TEMPORAERER Fallback bis die Control Library entsprechende Controls hat.
MITTELFRISTIGES ZIEL: Dieses Dict durch RAG/Control-Library-Abfragen ersetzen.
Neue Controls sollten in der Pipeline generiert werden, z.B.:
"Cookie-Tracking erfordert Art. 6(1)(a) Einwilligung (EuGH C-673/17 Planet49)"
→ canonical_controls mit scope_conditions + legal_ref
BIS DAHIN: Dieses Dict wird als Fallback genutzt mit einem Warning-Log wenn
es herangezogen wird. Bei jedem neuen Gesetz/Urteil muss SOWOHL die Pipeline
als auch dieses Dict aktualisiert werden — oder besser: das Dict entfernen und
nur noch Controls nutzen.
Erstellt: 2026-04-29 | Review-Datum: 2026-07-01 | Owner: Agent-Team
Common mistakes detected:
- Cookie tracking on lit. f (legitimate interest) instead of lit. a (consent)
- Marketing emails on lit. f instead of lit. a
- Analytics on lit. b (contract) — incorrect overextension
@@ -85,7 +101,15 @@ CORRECT_BASIS: dict[str, dict] = {
def validate_legal_bases(dse_text: str) -> list[LitFinding]:
"""Check if correct legal bases are used in the privacy policy."""
"""Check if correct legal bases are used in the privacy policy.
⚠️ Uses HARDCODED CORRECT_BASIS dict as fallback.
TODO: Replace with RAG/Control Library query when lit-mapping Controls exist.
"""
logger.warning(
"legal_basis_validator: Using HARDCODED rules (CORRECT_BASIS dict). "
"This should be replaced with Control Library queries. Review date: 2026-07-01"
)
findings = []
text_lower = dse_text.lower()