From 50fc0ecc596fb5632c85dbc7bb39d6a0c80a1a94 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Thu, 21 May 2026 15:59:01 +0200 Subject: [PATCH] feat(audit): P79 Pre-Scan-Wizard (8 Pflichtfelder) + P99 erweitert + P102 Replay-Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P79: PreScanWizard.tsx mit 8 Pflichtfeldern (Branche, B2B/B2C, Direkt-Vertrieb, Rechtsform, Konzern-Struktur, MA-Zahl, Besondere Daten, Drittland). Scan-Button disabled bis alle 8 ausgefuellt. Werte landen in scan_context und ueber Backend in compliance_check_snapshots. P99: DOC_TYPES um dsa + legal_notice + lizenzhinweise + nutzungsbedingungen erweitert. URL-hinzufuegen-Button war schon da. P102 (Replay-Bug): check_replay.py liest jetzt e.get('text') statt nur full_text — Snapshot-Schema verwendet 'text'. Library-Mismatch- Block wird damit auch im Replay angezeigt. Backend: ComplianceCheckRequest.scan_context optional; save_snapshot persistiert ihn in compliance_check_snapshots.scan_context. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../app/sdk/agent/_components/DocCheckTab.tsx | 27 +- .../sdk/agent/_components/PreScanWizard.tsx | 269 ++++++++++++++++++ .../api/agent_compliance_check_routes.py | 6 +- .../compliance/services/check_replay.py | 5 +- 4 files changed, 298 insertions(+), 9 deletions(-) create mode 100644 admin-compliance/app/sdk/agent/_components/PreScanWizard.tsx diff --git a/admin-compliance/app/sdk/agent/_components/DocCheckTab.tsx b/admin-compliance/app/sdk/agent/_components/DocCheckTab.tsx index 33e1c8f6..f08bf588 100644 --- a/admin-compliance/app/sdk/agent/_components/DocCheckTab.tsx +++ b/admin-compliance/app/sdk/agent/_components/DocCheckTab.tsx @@ -2,6 +2,7 @@ import React, { useState } from 'react' import { ChecklistView } from './ChecklistView' +import { PreScanWizard, useScanContext, isContextComplete } from './PreScanWizard' interface DocEntry { id: string @@ -11,13 +12,17 @@ interface DocEntry { } const DOC_TYPES = [ - { id: 'dse', label: 'DSI (Datenschutzinformation)' }, + { id: 'dse', label: 'Datenschutzerklärung / DSI' }, + { id: 'cookie', label: 'Cookie-Richtlinie' }, + { id: 'impressum', label: 'Impressum' }, + { id: 'agb', label: 'AGB' }, + { id: 'nutzungsbedingungen', label: 'Nutzungsbedingungen' }, + { id: 'widerruf', label: 'Widerrufsbelehrung' }, { id: 'social_media', label: 'DSE Social Media (Art. 26)' }, { id: 'dsfa', label: 'DSFA (Art. 35)' }, - { id: 'agb', label: 'AGB / Nutzungsbedingungen' }, - { id: 'impressum', label: 'Impressum' }, - { id: 'cookie', label: 'Cookie-Richtlinie' }, - { id: 'widerruf', label: 'Widerrufsbelehrung' }, + { id: 'dsa', label: 'DSA / Digital Services Act' }, + { id: 'legal_notice', label: 'Rechtliche Hinweise (IP, Forward-Looking)' }, + { id: 'lizenzhinweise', label: 'Lizenzhinweise Dritter (OSS)' }, { id: 'other', label: 'Sonstiges' }, ] @@ -26,6 +31,7 @@ function newEntry(): DocEntry { } export function DocCheckTab() { + const [scanContext, setScanContext] = useScanContext() const [entries, setEntries] = useState(() => { if (typeof window === 'undefined') return [newEntry()] try { const s = localStorage.getItem('doc-check-entries'); return s ? JSON.parse(s) : [newEntry()] } catch { return [newEntry()] } @@ -94,6 +100,7 @@ export function DocCheckTab() { })), check_cookie_banner: checkCookieBanner, use_agent: useAgent, + scan_context: scanContext, }), }) if (!startRes.ok) throw new Error(`Pruefung konnte nicht gestartet werden: ${startRes.status}`) @@ -133,8 +140,13 @@ export function DocCheckTab() { } } + const contextReady = isContextComplete(scanContext) + return (
+ {/* P79 Pre-Scan-Wizard — 8 Pflichtfelder */} + + {/* URL Entries */}
{entries.map((entry, i) => ( @@ -212,8 +224,9 @@ export function DocCheckTab() { {/* Submit */}