Files
leocrm/ARCHITECTURE_PLAN.md
T

462 lines
23 KiB
Markdown
Raw Normal View History

# Architektur-Plan — LeoCRM
**Prinzip: Auf bestehendem Code aufbauen. Nichts parallel bauen.**
## Bestehende UI-Struktur (geprüft am 2026-08-20)
### Rechte Sidebar — AISidebar.tsx (5 Tabs)
- `chat` — KI Chat (ChatWindow mit AI)
- `proactive` — Live KI (SuggestionList)
- `notifications` — Benachrichtigungen
- `team` — Team-Übersicht (Mitarbeiter + Gruppen)
- `chatroom` — Chat-Räume (MessageSidebar)
### MessageSidebar.tsx (671 Zeilen)
- Vollständiger Chat mit Conversations, Messages, WebSocket
- Nutzt `useCommStore`, `useCommWebSocket`, `BlockRenderer`
- Conversations: listConversations, getMessages, sendMessage, markRead, createConversation
- Wird in AppShell rechts angezeigt
### Communication.tsx (859 Zeilen)
- Volle Chat-Seite mit Conversations (system/ai/colleague Kategorien)
- Participants mit Rollen, Messages mit Blocks
- Pin/Unpin, Read, Create Conversation
- WebSocket-Integration, Markdown-Rendering
### comm/blocks/ (10 Block-Typen)
- text, markdown, html, image, audio, video, file, action_card, contact_card, miniapp
- BlockRenderer.tsx rendert alle Typen
- MiniAppBlock.tsx existiert (placeholder — rendert nur app_id + config)
### Dashboard.tsx
- StatCards (Kontakte, Firmen, Aktivitäten)
- ActivityFeed (Audit Log)
- DashboardGrid mit Widgets (RecentContacts, TasksSummary, CalendarUpcoming)
- Nutzt useUnifiedContacts, useAuditLog, useDashboardWidgets
### AgentDashboard.tsx
- Agent CRUD (create, update, delete)
- Execute Agent, Test Run Agent
- Agent Runs, Agent Versions, Restore Version
- Agent Tools, Send Agent Message
### Workflows.tsx
- Workflow CRUD (create, update, delete)
- Workflow Instances (List + Detail)
- WorkflowEditor (Step Config)
- Tabs: definitions, instances
### Wiki.tsx
- Wiki Categories + Articles
- Markdown Editor mit Preview
- Version History mit Restore
- WikiBrowser (Category Tree + Article List)
### components/knowledge/
- AskKnowledge.tsx — existiert schon
- KnowledgeGraph.tsx — existiert schon
### components/onboarding/
- OnboardingTour.tsx — existiert schon
- WelcomeDialog.tsx — existiert schon
### components/agents/
- AgentChat.tsx, AgentEditor.tsx, AgentMonitor.tsx, AgentRunLog.tsx — existieren schon
### components/workflows/
- StepConfigPanel.tsx, WorkflowEditor.tsx, WorkflowInstanceList.tsx, WorkflowInstanceDetail.tsx — existieren schon
### components/dashboard/
- DashboardGrid.tsx, RecentContactsWidget.tsx, TasksSummaryWidget.tsx, CalendarUpcomingWidget.tsx, DashboardWidgetLoader.tsx — existieren schon
### Stores
- commStore.ts — Conversation, Message, MessageBlock, MessageAttachment, Participant
- uiStore.ts — aiSidebarCollapsed, aiSidebarTab, notifications
- pluginStore.ts, pluginToolbarStore.ts — Plugin Manifests, Toolbar
- authStore.ts — Auth, User, Role
- onboardingStore.ts — Onboarding State
### API Clients
- api/comm.ts — listConversations, getMessages, sendMessage, markRead, createConversation
- api/ai.ts — createSession, fetchSessions, streamChat, fetchAgents
- api/automation.ts — useAgents, useCreateAgent, useUpdateAgent, useDeleteAgent, useExecuteAgent, useTestRunAgent, useAgentRuns, useAgentVersions, useRestoreAgentVersion, useAgentTools, useSendAgentMessage
- api/workflows.ts — useWorkflows, useDeleteWorkflow, useUpdateWorkflow
- api/knowledge.ts — createWikiArticle, deleteWikiArticle, fetchWikiArticle, fetchWikiCategories, fetchWikiVersions, restoreWikiVersion, updateWikiArticle
- api/dashboard.ts — useDashboardWidgets
- api/systemDashboard.ts — useSystemDashboard, useSystemAlerts
---
## Plan: Offene Tasks auf bestehender UI aufbauen
### Phase B/F/G Lücken (7 Tasks)
#### B-VEC-IVF: IVFFlat Index
- **Backend:** `app/core/db.py` — IVFFlat Index in config.py aktivieren (partial, schon da)
- **Frontend:** Keine UI-Änderung
- **Aufbauend auf:** unified_search Plugin (existiert schon)
#### B-STOR-EXT: External Storage (S3/Nextcloud)
- **Backend:** `app/core/storage.py` erweitern (existiert schon mit Local + S3 Backend)
- **Frontend:** `SettingsSystem.tsx` erweitern (existiert schon) — Storage-Config Sektion hinzufügen
- **Aufbauend auf:** storage.py (existiert schon), SettingsSystem.tsx (existiert schon)
#### B-NOTIF-DEPREC: Notification Model aufräumen
- **Backend:** Altes Notification Model entfernen, auf system_notif Plugin migrieren
- **Frontend:** Keine UI-Änderung (system_notif Plugin hat eigene UI)
- **Aufbauend auf:** system_notif Plugin (existiert schon)
#### F-PREBUILT: Pre-built Agents registrieren
- **Backend:** `automation/plugin.py on_activate` — import prebuilt agents (email_triage, contact_enrichment, follow_up, report)
- **Frontend:** AgentDashboard.tsx zeigt sie automatisch (existiert schon, nutzt useAgents)
- **Aufbauend auf:** AgentDashboard.tsx (existiert schon), prebuilt/ agents (existieren schon)
#### F-COMM: Agent → Kommunikation (Run-Results posten)
- **Backend:** `agent_runner.py` — nach Agent-Run, poste Ergebnis als Message in Communication
- Nutze `kommunikation.contracts.send_message()` (existiert schon)
- Erstelle CommMessage mit Block vom Typ `action_card` (existiert schon in BlockRenderer)
- **Frontend:** MessageSidebar.tsx und Communication.tsx zeigen die Messages automatisch (existieren schon)
- **Aufbauend auf:** kommunikation Plugin (existiert schon), MessageSidebar.tsx (existiert schon), Communication.tsx (existiert schon), BlockRenderer mit action_card (existiert schon)
#### F-WORK: Agent Workstream
- **Backend:** `agent_runner.py` — poste Agent-Status (started/progress/completed/failed) als CommMessage in eine Agent-Conversation
- Nutze `kommunikation.contracts.create_plugin_room()` (existiert schon)
- Nutze `send_message()` mit Blocks (existiert schon)
- **Frontend:** AISidebar `chatroom` Tab zeigt die Agent-Conversation automatisch (existiert schon)
- **Aufbauend auf:** AISidebar.tsx chatroom Tab (existiert schon), MessageSidebar.tsx (existiert schon), kommunikation Plugin (existiert schon)
#### G-WORK: Workflow Workstream
- **Backend:** `engine.py` — poste Workflow-Status als CommMessage in eine Workflow-Conversation
- Nutze `kommunikation.contracts.create_plugin_room()` (existiert schon)
- Nutze `send_message()` mit Blocks (existiert schon)
- **Frontend:** AISidebar `chatroom` Tab zeigt die Workflow-Conversation automatisch (existiert schon)
- **Aufbauend auf:** AISidebar.tsx chatroom Tab (existiert schon), engine.py (existiert schon), kommunikation Plugin (existiert schon)
---
### Phase H Rest (12 Tasks)
#### H-EXT: Knowledge Extraction Pipeline
- **Backend:** Neues `app/plugins/builtins/knowledge/` Plugin
- `services/extraction.py` — nutze `llm_client.llm_complete()` (existiert schon) für Entity/Relationship Extraction
- `services/source_adapter.py` — nutze `unified_search` Provider (existieren schon) als Knowledge Sources
- `services/relationship_extractor.py` — nutze `graph_rag.services.create_relationship()` (existiert schon)
- **Frontend:** Wiki.tsx (existiert schon) — "Extract Knowledge" Button hinzufügen
- **Aufbauend auf:** llm_client (existiert schon), graph_rag Plugin (existiert schon), unified_search Plugin (existieren schon), Wiki.tsx (existiert schon)
#### H-ENT: Entity Extraction
- **Backend:** In `knowledge/services/extraction.py` (siehe H-EXT)
- **Frontend:** KnowledgeGraph.tsx (existiert schon) — zeigt extrahierte Entities
- **Aufbauend auf:** KnowledgeGraph.tsx (existiert schon), graph_rag Plugin (existiert schon)
#### H-AUTO: Auto-Create Relationships in GraphRAG
- **Backend:** In `knowledge/services/relationship_extractor.py` (siehe H-EXT)
- **Frontend:** KnowledgeGraph.tsx (existiert schon) — zeigt Relationships automatisch
- **Aufbauend auf:** KnowledgeGraph.tsx (existiert schon), graph_rag Plugin (existiert schon)
#### H-CONF: Confidence Scoring + Review Queue
- **Backend:** In `knowledge/services/extraction.py` — Confidence Score pro Extraction
- **Frontend:** Wiki.tsx (existiert schon) — Review-Queue Sektion hinzufügen
- **Aufbauend auf:** Wiki.tsx (existiert schon)
#### H-EVT: Event-Driven Extraction
- **Backend:** In `knowledge/plugin.py on_activate` — registriere Hooks für `contact.after_create`, `file.created`, `mail.received`
- **Frontend:** Keine UI-Änderung
- **Aufbauend auf:** hooks.py (existiert schon), do_action Events (existieren schon)
#### H-CITE: Evidence References
- **Backend:** In `knowledge/services/source_adapter.py` — Evidence References mit Deep-Links
- **Frontend:** AskKnowledge.tsx (existiert schon) — Evidence-Cards hinzufügen
- **Aufbauend auf:** AskKnowledge.tsx (existiert schon)
#### H-RET: Retention Policy
- **Backend:** In `knowledge/plugin.py` — ARQ Cron-Job für Knowledge Retention
- **Frontend:** Keine UI-Änderung
- **Aufbauend auf:** worker.py cron jobs (existieren schon)
#### H-WIKI-SEARCH: Wiki Search Provider
- **Backend:** In `wiki/plugin.py on_activate` — registriere WikiSearchProvider bei `unified_search`
- **Frontend:** Keine UI-Änderung (Search läuft über unified_search)
- **Aufbauend auf:** unified_search Plugin (existiert schon), wiki Plugin (existiert schon)
#### H-DATA-LIFE: Derived-Data Lifecycle
- **Backend:** In `knowledge/services/extraction.py` — bei Entity-Update, re-extract
- **Frontend:** Keine UI-Änderung
- **Aufbauend auf:** hooks.py (existiert schon)
#### H-ASK: Ask Knowledge
- **Backend:** In `knowledge/routes.py``/api/v1/knowledge/ask` Endpoint
- **Frontend:** AskKnowledge.tsx (existiert schon) — mit API verbinden
- **Aufbauend auf:** AskKnowledge.tsx (existiert schon), llm_client (existiert schon)
#### H-REV: Relationship Review Queue
- **Backend:** In `knowledge/routes.py` — Review Queue API
- **Frontend:** KnowledgeGraph.tsx (existiert schon) — Review-Queue Sektion
- **Aufbauend auf:** KnowledgeGraph.tsx (existiert schon)
#### H-DOC: Documentation
- **Doku:** docs/api-documentation.md erweitern, docs/plugin-development-guide.md erweitern
- **Aufbauend auf:** existierende Doku-Dateien
---
### Phase I (25 Tasks)
#### I.1 Cross-System Integration (7 Tasks)
##### I-AW: Agent → Workflow
- **Backend:** `agent_tools.py``start_workflow` und `check_workflow_status` als Agent Tools registrieren
- **Frontend:** Keine UI-Änderung (Agent nutzt Tool im Hintergrund)
- **Aufbauend auf:** agent_tools.py (existiert schon), workflows.py routes (existieren schon)
##### I-AS: Agent → Search
- **Backend:** `agent_tools.py``unified_search` als Agent Tool registrieren (existiert schon)
- **Frontend:** Keine UI-Änderung
- **Aufbauend auf:** unified_search Plugin (existiert schon), agent_tools.py (existiert schon)
##### I-AK: Agent → Knowledge
- **Backend:** `agent_tools.py``ask_knowledge` und `search_knowledge` als Agent Tools registrieren
- **Frontend:** Keine UI-Änderung
- **Aufbauend auf:** knowledge Plugin (siehe Phase H), agent_tools.py (existiert schon)
##### I-APPR-LOOP: Agent Approval Integration
- **Backend:** `agent_runner.py``require_approval` Parameter durchreichen (existiert schon)
- **Frontend:** AgentDashboard.tsx (existiert schon) — Approval-Status anzeigen
- **Aufbauend auf:** agent_runner.py (existiert schon), approvals.py routes (existieren schon), AgentDashboard.tsx (existiert schon)
##### I-MCP: MCP Exposure
- **Backend:** `app/ai/mcp_exposure.py` — MCP Tools definieren (existiert schon)
- **Frontend:** SettingsMcp.tsx (existiert schon) — MCP Config UI
- **Aufbauend auf:** mcp_exposure.py (existiert schon), SettingsMcp.tsx (existiert schon)
##### I-WA: Workflow → Agent
- **Backend:** `step_handlers.py``agent` step type (existiert schon)
- **Frontend:** Workflows.tsx (existiert schon) — Step Config zeigt agent step
- **Aufbauend auf:** step_handlers.py (existiert schon), Workflows.tsx (existiert schon)
##### I-KS: Knowledge → Search
- **Backend:** `knowledge/plugin.py on_activate` — registriere Search Provider (siehe H-WIKI-SEARCH)
- **Frontend:** Keine UI-Änderung
- **Aufbauend auf:** unified_search Plugin (existiert schon)
#### I.2 Human-AI Workstream (11 Tasks)
##### I-WORK-BASE: Workstream Basis
- **Backend:** Nutze `kommunikation.contracts.send_message()` (existiert schon) für alle Workstream-Posts
- **Frontend:** MessageSidebar.tsx (existiert schon) zeigt Workstream automatisch
- **Aufbauend auf:** kommunikation Plugin (existiert schon), MessageSidebar.tsx (existiert schon)
##### I-WORK-ACTOR: Workstream Actors
- **Backend:** Nutze `kommunikation.contracts.create_plugin_room()` (existiert schon) für Actor-spezifische Räume
- **Frontend:** Communication.tsx (existiert schon) zeigt Räume automatisch
- **Aufbauend auf:** kommunikation Plugin (existiert schon), Communication.tsx (existiert schon)
##### I-WORK-HANDOFF: Human-Agent Handoff
- **Backend:** `agent_runner.py` — bei Approval-Request, poste in Communication
- **Frontend:** MessageSidebar.tsx (existiert schon) zeigt Handoff-Nachricht mit action_card Block
- **Aufbauend auf:** kommunikation Plugin (existiert schon), action_card Block (existiert schon), MessageSidebar.tsx (existiert schon)
##### I-WORK-PROACTIVE: Proactive Feed
- **Backend:** `app/ai/proactive_feed.py` (existiert schon) — poste Vorschläge in Communication
- **Frontend:** AISidebar `proactive` Tab (existiert schon) — SuggestionList zeigt Vorschläge
- **Aufbauend auf:** AISidebar.tsx proactive Tab (existiert schon), SuggestionList (existiert schon)
##### I-MINI-RENDER: MiniApp Rendering
- **Backend:** `kommunikation/miniapp_registry.py` (existiert schon) — MiniApp Manifests
- **Frontend:** MiniAppBlock.tsx (existiert schon) — von Placeholder zu echtem Rendering ausbauen
- Lade MiniApp Manifest vom Backend
- Rendere MiniApp iframe oder React-Komponente
- **Aufbauend auf:** MiniAppBlock.tsx (existiert schon), miniapp_registry.py (existiert schon), BlockRenderer (existiert schon)
##### I-MINI-SDK: MiniApp SDK
- **Backend:** `kommunikation/miniapp_registry.py` (existiert schon) — SDK Definition
- **Frontend:** MiniAppBlock.tsx (existiert schon) — SDK API für MiniApps
- **Aufbauend auf:** MiniAppBlock.tsx (existiert schon)
##### I-MINI-MANIFEST: MiniApp Manifests
- **Backend:** Plugin Manifests (existieren schon) — MiniApp Sektion
- **Frontend:** SettingsPlugins.tsx (existiert schon) — zeige MiniApp Manifests
- **Aufbauend auf:** SettingsPlugins.tsx (existiert schon), pluginStore.ts (existiert schon)
##### I-WORK-E2E: Workstream E2E
- **Backend:** Alle Workstream-Posts laufen über Communication API
- **Frontend:** Communication.tsx (existiert schon) — zeigt alle Workstream-Posts
- **Aufbauend auf:** Communication.tsx (existiert schon)
##### I-UI: Block Renderer Erweiterung
- **Frontend:** BlockRenderer.tsx (existiert schon) — neue Block-Typen hinzufügen:
- `agent_result` — Agent Ergebnis Card
- `approval_request` — Approval Card mit Approve/Reject Buttons
- `task_card` — Task Card
- `workflow_card` — Workflow Status Card
- `knowledge_card` — Knowledge Extraction Card
- **Aufbauend auf:** BlockRenderer.tsx (existiert schon), comm/blocks/ (existieren schon)
##### I-GROUP: Group Chat
- **Backend:** `kommunikation` Plugin (existiert schon) — Group Conversations
- **Frontend:** Communication.tsx (existiert schon) — Group Chat UI
- **Aufbauend auf:** Communication.tsx (existiert schon), commStore.ts (existiert schon)
##### I-MOBILE: Mobile Responsive
- **Frontend:** AISidebar.tsx (existiert schon) — Mobile Anpassung
- **Aufbauend auf:** AISidebar.tsx (existiert schon), ResizablePanel (existiert schon)
#### I.3 Dashboard (3 Tasks)
##### I-DASH: Platform Dashboard
- **Frontend:** Dashboard.tsx (existiert schon) — erweitern mit System-Metriken
- Nutze useSystemDashboard() (existiert schon in api/systemDashboard.ts)
- Zeige DB, Redis, Worker, API, Plugin Status
- **Aufbauend auf:** Dashboard.tsx (existiert schon), api/systemDashboard.ts (existiert schon), DashboardGrid.tsx (existiert schon)
##### I-COST: Cost Tracking
- **Backend:** `app/ai/llm_client.py` (existiert schon) — Cost Tracking pro Tenant
- **Frontend:** Dashboard.tsx (existiert schon) — Cost Widget hinzufügen
- **Aufbauend auf:** Dashboard.tsx (existiert schon), llm_client.py (existiert schon)
##### I-USE: Usage Analytics
- **Backend:** `app/routes/system_dashboard.py` (existiert schon) — Usage Stats
- **Frontend:** Dashboard.tsx (existiert schon) — Usage Widget
- **Aufbauend auf:** system_dashboard.py (existiert schon), Dashboard.tsx (existiert schon)
#### I.4 Performance (5 Tasks)
- **Backend:** Query-Optimierung, Caching, Connection Pooling
- **Frontend:** Keine UI-Änderung
- **Aufbauend auf:** db.py (existiert schon), Redis (existiert schon)
#### I.5 DSGVO (3 Tasks)
##### I-DSGVO: DSGVO Export
- **Backend:** `app/routes/system_settings.py` (existiert schon) — DSGVO Export Route
- **Frontend:** SettingsSystem.tsx (existiert schon) — DSGVO Export Button
- **Aufbauend auf:** system_settings.py (existiert schon), SettingsSystem.tsx (existiert schon)
##### I-DSAR: DSAR Workflow
- **Backend:** ARQ Job für DSAR Processing
- **Frontend:** SettingsSystem.tsx (existiert schon) — DSAR Status
- **Aufbauend auf:** worker.py (existiert schon), SettingsSystem.tsx (existiert schon)
##### I-COMP-EXPORT: Compliance Export
- **Backend:** Audit Log Export (existiert schon — /api/v1/audit-log/export)
- **Frontend:** AuditLog.tsx (existiert schon) — Export Button
- **Aufbauend auf:** audit.py routes (existieren schon), AuditLog.tsx (existiert schon)
#### I.6 Onboarding (3 Tasks)
##### I-ONB: Onboarding Wizard
- **Frontend:** OnboardingTour.tsx (existiert schon) + WelcomeDialog.tsx (existiert schon) — erweitern mit Setup Steps
- **Backend:** `app/ai/onboarding.py` (existiert schon) — Onboarding Status API
- **Aufbauend auf:** OnboardingTour.tsx (existiert schon), WelcomeDialog.tsx (existiert schon), onboardingStore.ts (existiert schon)
#### I.7 Final Polish (3 Tasks)
- **Frontend:** tsc clean, i18n vervollständigen, ARIA-Labels prüfen
- **Aufbauend auf:** existierende Frontend-Dateien
---
### Phase J (10 Tasks)
#### J-SIGNAL: Improvement Signals
- **Backend:** Neues `app/plugins/builtins/self_improvement/` Plugin
- `models.py` — ImprovementSignal, ImprovementProposal, ImpactMeasurement (SQLAlchemy Models, keine Dataclasses)
- `routes.py``/api/v1/improvement/signals`, `/api/v1/improvement/proposals`
- `services.py` — Signal Collection aus AuditLog, AgentRun, WorkflowInstance
- **Frontend:** Keine neue Page — nutze AISidebar `proactive` Tab (existiert schon) für Signal-Anzeige
- **Aufbauend auf:** AuditLog (existiert schon), AgentRun (existiert schon), WorkflowInstance (existiert schon), AISidebar proactive Tab (existiert schon)
#### J-PATTERN: Pattern Detection
- **Backend:** In `self_improvement/services.py` — Pattern Detection aus Signals
- **Frontend:** AISidebar `proactive` Tab (existiert schon) — Pattern Insights
- **Aufbauend auf:** SuggestionList (existiert schon)
#### J-PROP: Improvement Proposals
- **Backend:** In `self_improvement/models.py` — ImprovementProposal Model
- **Frontend:** Communication.tsx (existiert schon) — Proposal als action_card Block in System-Conversation
- **Aufbauend auf:** Communication.tsx (existiert schon), action_card Block (existiert schon)
#### J-DRAFT: Versioned Drafts
- **Backend:** In `self_improvement/models.py` — Draft Versioning
- **Frontend:** AgentDashboard.tsx (existiert schon) — Draft Version History (ähnlich Agent Versions)
- **Aufbauend auf:** AgentDashboard.tsx (existiert schon), useAgentVersions (existiert schon)
#### J-EVAL: Evaluation
- **Backend:** In `self_improvement/services.py` — Dry-Run Evaluation
- **Frontend:** AgentDashboard.tsx (existiert schon) — Evaluation Results
- **Aufbauend auf:** AgentDashboard.tsx (existiert schon), useTestRunAgent (existiert schon)
#### J-APPROVAL: Human Approval
- **Backend:** Nutze `app.core.approval.create_approval_request()` (existiert schon)
- **Frontend:** Communication.tsx (existiert schon) — Approval als action_card Block
- **Aufbauend auf:** approvals.py routes (existieren schon), Communication.tsx (existiert schon), action_card Block (existiert schon)
#### J-ACTIVATE: Controlled Activation
- **Backend:** In `self_improvement/services.py` — Activation + Rollback
- **Frontend:** AgentDashboard.tsx (existiert schon) — Activate/Rollback Button
- **Aufbauend auf:** AgentDashboard.tsx (existiert schon), useRestoreAgentVersion (existiert schon)
#### J-MEASURE: Impact Measurement
- **Backend:** In `self_improvement/services.py` — Pre/Post Measurement
- **Frontend:** Dashboard.tsx (existiert schon) — Impact Widget
- **Aufbauend auf:** Dashboard.tsx (existiert schon), DashboardGrid.tsx (existiert schon)
#### J-UI: Improvement UI
- **Frontend:** AISidebar `proactive` Tab (existiert schon) — Improvement Proposals + Patterns
- **Aufbauend auf:** AISidebar.tsx (existiert schon), SuggestionList (existiert schon)
#### J-DOC: Documentation
- **Doku:** docs/api-documentation.md erweitern
- **Aufbauend auf:** existierende Doku-Dateien
---
### Phase K (6 Tasks)
#### K-AI-REG: AI Registry
- **Backend:** `app/ai/ai_use_case.py` (existiert schon) — AI Use Case Registry
- **Frontend:** SettingsAI.tsx (existiert schon) — AI Use Case Liste
- **Aufbauend auf:** ai_use_case.py (existiert schon), SettingsAI.tsx (existiert schon)
#### K-DSR: Data Subject Rights
- **Backend:** ARQ Job für DSR Processing (siehe I-DSAR)
- **Frontend:** SettingsSystem.tsx (existiert schon) — DSR Status
- **Aufbauend auf:** SettingsSystem.tsx (existiert schon), worker.py (existiert schon)
#### K-DPIA: DPIA Documentation
- **Doku:** `docs/dpia.md` — DPIA Dokumentation
- **Aufbauend auf:** existierende Doku-Struktur
#### K-AI-ACT: AI Act Compliance
- **Backend:** `app/ai/ai_use_case.py` (existiert schon) — Risk Assessment pro Use Case
- **Frontend:** SettingsAI.tsx (existiert schon) — Risk Assessment UI
- **Aufbauend auf:** ai_use_case.py (existiert schon), SettingsAI.tsx (existiert schon)
#### K-AUDIT: Compliance Audit
- **Backend:** Audit Log Export (existiert schon) — Compliance Report
- **Frontend:** AuditLog.tsx (existiert schon) — Compliance Export
- **Aufbauend auf:** audit.py routes (existieren schon), AuditLog.tsx (existiert schon)
#### K-DOC: Documentation
- **Doku:** `docs/compliance.md` — Compliance Dokumentation
- **Aufbauend auf:** existierende Doku-Struktur
---
## Zusammenfassung
**Jeder Task baut auf bestehendem Code auf:**
- Keine neuen Frontend-Pages — nutze vorhandene Pages (Dashboard, Communication, AgentDashboard, Workflows, Wiki, Settings)
- Keine neuen Sidebars — nutze vorhandene AISidebar (5 Tabs) und MessageSidebar
- Keine neuen Block-Typen wo vorhandene reichen — nutze action_card, contact_card, miniapp (existieren schon)
- Keine neuen Stores — nutze commStore, uiStore, authStore (existieren schon)
- Keine neuen API-Clients wo vorhandene reichen — nutze api/comm.ts, api/ai.ts, api/automation.ts, api/workflows.ts, api/knowledge.ts (existieren schon)
- Keine Dataclasses — nutze echte SQLAlchemy Models + FastAPI Routes
- Keine Mock-Tests — nutze echte Integration-Tests mit Test-DB
**Neue Dateien nur wo wirklich nötig:**
- `app/plugins/builtins/knowledge/` — neues Plugin (Phase H)
- `app/plugins/builtins/self_improvement/` — neues Plugin (Phase J)
- Neue Block-Typen in `comm/blocks/` — agent_result, approval_request, task_card, workflow_card, knowledge_card (Phase I)
- Migrationen für neue Tabellen
**Aufwand:** ~21 Tage (7 Tasks B/F/G + 12 Tasks H + 25 Tasks I + 10 Tasks J + 6 Tasks K = 60 Tasks)