fix(impressum): sector-gate respects on-topic criteria (parity with DSE)
A clearly impressum-thematic control (e.g. MStV 18 with inherited GOV prefix) is no longer dropped by the sector-prefix gate - topic overlap is the stronger signal. Mirrors dse/v3_engine. Salvaged WIP. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -182,12 +182,18 @@ def _filter_controls(
|
|||||||
for c in controls:
|
for c in controls:
|
||||||
cid = c.get("control_id") or ""
|
cid = c.get("control_id") or ""
|
||||||
prefix = cid.split("-")[0].upper() if "-" in cid else ""
|
prefix = cid.split("-")[0].upper() if "-" in cid else ""
|
||||||
|
on_topic = criteria_on_topic(c.get("pass_criteria"),
|
||||||
|
c.get("fail_criteria"))
|
||||||
required = SECTOR_PREFIXES.get(prefix)
|
required = SECTOR_PREFIXES.get(prefix)
|
||||||
if required and not (scope_lc & required):
|
# Sektor-Gate nur fuer NICHT-on-topic Controls: ein klar
|
||||||
|
# impressum-thematischer Control (z.B. MStV §18(1) mit GOV-Prefix
|
||||||
|
# aus der Domain-Erkennung der Control-Generierung) darf nicht am
|
||||||
|
# Branchen-Prefix scheitern. Der Themen-Ueberlapp ist der staerkere
|
||||||
|
# Relevanz-Beweis als ein vererbter ID-Prefix.
|
||||||
|
if required and not (scope_lc & required) and not on_topic:
|
||||||
sector_dropped += 1
|
sector_dropped += 1
|
||||||
continue
|
continue
|
||||||
if not criteria_on_topic(c.get("pass_criteria"),
|
if not on_topic:
|
||||||
c.get("fail_criteria")):
|
|
||||||
offtopic_dropped += 1
|
offtopic_dropped += 1
|
||||||
continue
|
continue
|
||||||
kept.append(c)
|
kept.append(c)
|
||||||
|
|||||||
Reference in New Issue
Block a user