diff --git a/backend-compliance/compliance/api/agent_compliance_check_routes.py b/backend-compliance/compliance/api/agent_compliance_check_routes.py index 18d8bffc..6ece4bbb 100644 --- a/backend-compliance/compliance/api/agent_compliance_check_routes.py +++ b/backend-compliance/compliance/api/agent_compliance_check_routes.py @@ -536,6 +536,15 @@ async def _run_compliance_check(check_id: str, req: ComplianceCheckRequest): cookie_payloads.extend(e["cmp_payloads"]) if e.get("text"): cookie_text = e["text"] + # P17-D: Fallback wenn cookie via P15 deduped wurde — nutze DSE-Text + # sofern Cookie-Begriffe drin sind, damit LLM-Vendor-Extract trotzdem + # greifen kann. + if not cookie_text and not cookie_payloads: + dse_t = doc_texts.get("dse", "") + if dse_t and any(w in dse_t.lower() for w in + ("cookie", "tracking", "google analytics", "consent")): + cookie_text = dse_t + logger.info("P17-D: vendor-extract Fallback auf DSE (Cookie deduped)") # Site-owner derived from the submitted URLs — drives the # INTERNAL/GROUP_COMPANY classification of vendor records. owner_name = _company_name_from_url(doc_entries) or "" @@ -681,6 +690,19 @@ async def _run_compliance_check(check_id: str, req: ComplianceCheckRequest): cookie_doc_url = e.get("url", "") cookie_cmp_payloads = e.get("cmp_payloads") or [] break + # P17-A: Fallback wenn Cookie-Doc via P15 deduped wurde — nutze + # den DSE-Text wenn er Cookie-Schluesselwoerter enthaelt. + if not cookie_doc_text: + dse_text = doc_texts.get("dse", "") + if dse_text and any(w in dse_text.lower() for w in + ("cookie", "tracking", "google analytics", + "consent")): + cookie_doc_text = dse_text + dse_entry = next((e for e in doc_entries + if e.get("doc_type") == "dse"), {}) + cookie_doc_url = dse_entry.get("url", "") + cookie_cmp_payloads = dse_entry.get("cmp_payloads") or [] + logger.info("P17-A: cookie-arch fallback auf DSE (Cookie-Doc deduped)") if cookie_doc_text: arch = detect_architecture( doc_url=cookie_doc_url, diff --git a/backend-compliance/compliance/api/agent_doc_check_report.py b/backend-compliance/compliance/api/agent_doc_check_report.py index fa1aefab..77c0cb97 100644 --- a/backend-compliance/compliance/api/agent_doc_check_report.py +++ b/backend-compliance/compliance/api/agent_doc_check_report.py @@ -182,7 +182,7 @@ def build_management_summary(results: list[DocCheckResult]) -> str: if c.level == 1 and not c.passed and not c.skipped and c.severity != "INFO" ] - for c in failed_checks[:3]: # Max 3 per document + for c in failed_checks: # P17-B: kein Per-Doc-Cap action = _check_to_action(r.label, c.label, c.hint) if action: actions.append(action) @@ -193,7 +193,7 @@ def build_management_summary(results: list[DocCheckResult]) -> str: 'Konkrete Aufgaben:' '