fix(compliance-check): always render 8 doc types + 4 BMW GT-gap fixes
Always-show-8 (user-requested): - agent_compliance_check_routes.py: _pad_results_with_missing pads the results list to always include all 8 canonical doc_types in canonical order. Missing types get a placeholder DocCheckResult with error= 'Nicht eingereicht' + scenario='missing'. - agent_doc_check_report.py: NICHT EINGEREICHT status label (neutral), friendly grey body block instead of red error. - ChecklistView.tsx: 'Nicht eingereicht' chip (neutral grey, not red 'Fehler'); SCENARIO_LABELS adds missing entry + header chip counter. Impressum-Regression fix (#18): - _fetch_text(url, doc_type): cookie/dse/social_media -> max_documents=1 (CMP capture authoritative, sub-pages dilute). Other types -> =3 (Impressum needs Versicherungsvermittler, Aufsicht, Berufsrecht sub- pages). 15s networkidle bail keeps timing safe. ODR/Verbraucherstreitbeilegung filter (#19): - _apply_profile_filter: when profile.needs_odr=True (B2C), override the check's default B2B-oriented hint with action-oriented B2C guidance pointing at Art. 14 EU-VO 524/2013 + §36 VSBG. Previously the check contradicted itself: 'profile says B2C' + hint 'only relevant for B2C online vendors'. Registergericht regex (#20): - impressum_checks.py: accept colon/dot/dash between keyword and city (BMW writes 'registergericht: münchen hrb 42243'). Add 'sitz und registergericht: X' as separate pattern. Industry detection (#21): - business_profiler.py: 'automotive' keywords broadened (antriebs, motor, leasing, werkstatt, probefahrt, plus brand names BMW/Mercedes/ Audi/VW/Porsche/Opel). 'it_services' keywords narrowed — software/ cloud/hosting are mentioned in every privacy policy and were biasing the result toward IT for any tech-aware company.
This commit is contained in:
@@ -184,7 +184,10 @@ def _render_document(html: list[str], r: DocCheckResult) -> None:
|
||||
cpct = r.correctness_pct
|
||||
bar_color = "green" if pct >= 80 else "yellow" if pct >= 50 else "red"
|
||||
status_label = "OK" if pct == 100 else "LUECKENHAFT" if pct >= 50 else "MANGELHAFT"
|
||||
if r.error:
|
||||
is_missing = bool(r.error) and r.error.startswith("Nicht eingereicht")
|
||||
if is_missing:
|
||||
status_label = "NICHT EINGEREICHT"
|
||||
elif r.error:
|
||||
status_label = "FEHLER"
|
||||
|
||||
l1_checks = [c for c in r.checks if c.level == 1]
|
||||
@@ -216,7 +219,16 @@ def _render_document(html: list[str], r: DocCheckResult) -> None:
|
||||
html.append('</div></div></div>')
|
||||
|
||||
# Body
|
||||
if r.error:
|
||||
if is_missing:
|
||||
html.append(
|
||||
'<div style="padding:12px 16px;color:#6b7280;font-size:12px;'
|
||||
'background:#fafafa;border-top:1px solid #f3f4f6">'
|
||||
'Keine URL oder Text fuer dieses Dokument angegeben. '
|
||||
'Tragen Sie die Quelle im Compliance-Check Formular nach, '
|
||||
'um diese Pflichtangabe zu pruefen.'
|
||||
'</div>'
|
||||
)
|
||||
elif r.error:
|
||||
html.append(f'<div style="padding:12px 16px;color:#991b1b">{r.error}</div>')
|
||||
else:
|
||||
html.append('<div style="padding:8px 16px 12px">')
|
||||
|
||||
Reference in New Issue
Block a user