fix(cra): Konformitätspfad-Kacheln korrekt benennen + Gating nach CRA Art. 32

(a) Labels: Module korrekt zugeordnet — Modul A = Selbstbewertung, Modul B+C =
    benannte Stelle, EUCC = eigenes Zertifikat (nicht Modul H), "harmonisierte
    Norm" ist kein Modul sondern Konformitätsvermutung. Für den CRA noch KEINE
    harmonisierte Norm veröffentlicht → Kachel als "noch nicht verfügbar"
    (erwartet ~2027), nicht wählbar, mit Hinweis. (page/path/documents-Labels.)
(b) Gating: wichtige Klasse II + kritische Produkte dürfen NICHT selbst bewerten;
    harmonisierte Norm allein genügt dort nicht → ALLOWED_PATHS IMPORTANT_II/
    CRITICAL = {eucc, notified_body}; DEFAULT_FOR II = notified_body. _PATH_HINT
    entsprechend. Regressionstest test_cra_conformity_paths.py.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-06-15 13:49:00 +02:00
parent e1f89f6226
commit 731076835d
8 changed files with 105 additions and 61 deletions
@@ -0,0 +1,31 @@
"""Pin the CRA conformity-path gating (CRA Art. 32 / Anhang VIII).
Regression: wichtige Klasse-II- und kritische Produkte duerfen NICHT selbst
bewerten — eine harmonisierte Norm allein genuegt dort nicht.
"""
from compliance.api.cra_routes import ALLOWED_PATHS, CONFORMITY_PATHS
def test_self_assessment_only_for_standard_and_important_i():
assert "self_assessment" in ALLOWED_PATHS["STANDARD"]
assert "self_assessment" in ALLOWED_PATHS["IMPORTANT_I"]
assert "self_assessment" not in ALLOWED_PATHS["IMPORTANT_II"]
assert "self_assessment" not in ALLOWED_PATHS["CRITICAL"]
def test_important_ii_needs_notified_body_or_eucc():
# Klasse II: harmonisierte Norm allein ist KEIN gueltiger Pfad.
assert ALLOWED_PATHS["IMPORTANT_II"] == {"eucc", "notified_body"}
def test_critical_allows_eucc_and_notified_body():
assert ALLOWED_PATHS["CRITICAL"] == {"eucc", "notified_body"}
def test_not_in_scope_has_no_paths():
assert ALLOWED_PATHS["NOT_IN_SCOPE"] == set()
def test_all_allowed_paths_are_known():
for paths in ALLOWED_PATHS.values():
assert paths <= CONFORMITY_PATHS