# LeoCRM — Worklog ## 2026-08-04 — Security Fix Plan Phase 4: Krisensicherheit **Commit:** a26405f **Tests:** 30/30 resilience tests pass ### Implementiert: - app/core/resilience.py: CircuitBreaker (CLOSED/OPEN/HALF_OPEN), retry_db, redis_call_with_fallback, InMemoryRateLimiter, CircuitBreakerMiddleware - app/core/auth.py: get_session_data() mit DB-Fallback (sessions table) bei Redis-Ausfall - app/core/permissions.py: get_cached_permissions() mit DB-Fallback bei Redis-Ausfall - app/core/rate_limit.py: check_rate_limit() mit InMemoryRateLimiter Fallback - app/core/middleware.py: CSRF-Validierung nutzt get_session_data() (Redis+DB), best-effort TTL - app/core/db/__init__.py: get_db() mit retry_db() für transiente Verbindungsfehler - app/deps.py: refresh_session_ttl() in try/except für Redis-Ausfall - app/main.py: CircuitBreakerMiddleware registriert (503 bei offenem DB-Circuit) - app/config.py: Resilience-Settings (thresholds, cooldown, retries) - tests/test_resilience.py: 30 Tests ### Verifikation: - 30/30 Resilience-Tests ✅ - Health Check: 200 ✅ - Login: 200 ✅ - Deploy über Coolify erfolgreich --- ## 2026-08-04 — Security Fix Plan Phase 5.1-5.4: Architektur-Lücken (Teil 1) **Commit:** cfb4c5a ### 5.1 Public Plugin Endpoints: - PluginRouteDef.is_public Field in manifest.py - main.py: Public Routes ohne Auth-Dependency mounten - permissions/public_routes.py: token-basierte Share-Link Zugriff (info, verify, download) ### 5.2 PWA: - VitePWA in vite.config.ts konfiguriert (autoUpdate, workbox, runtime caching) - manifest.json mit Icons, theme-color, apple-mobile-web-app meta tags - Build generiert sw.js + workbox (90 precache entries) ### 5.3 Contacts Embedding: - Vector(768) embedding Column zum Contact model hinzugefügt - Migration 0002_embeddings.sql existiert bereits (HNSW Index) ### 5.4 Search Coverage: - 5 neue Search Provider: task, contactperson, tag, conversation, user - Total: 10 Search Provider (war 5) - provider_registry.py aktualisiert ### Verifikation: - py_compile: 17 Dateien OK ✅ - tsc --noEmit: clean ✅ - Frontend build: success (sw.js generiert) ✅ - Health Check: 200 ✅, Login: 200 ✅ --- ## 2026-08-04 — Security Fix Plan Phase 5.5-5.9: Architektur-Lücken (Teil 2) **Commit:** 000c969 **Files:** 36 files changed, +3118 lines ### 5.5 Plugin-Marketplace: - Neues Plugin: marketplace/ (models, routes, services, schemas, config) - MarketplaceListing model (global, keine tenant_id) - Ed25519 Signatur-Verifikation via PluginSignature - Endpoints: list, detail, install, verify, categories ### 5.6 Agent Memory (persistent): - Neues Plugin: agent_memory/ (models, routes, services, schemas) - AgentMemory model mit embedding vector(768) + HNSW index - store_memory() mit auto-embedding - retrieve_relevant_memories() mit pgvector cosine similarity ### 5.7 GraphRAG: - Neues Plugin: graph_rag/ (models, routes, services, provider, schemas) - EntityRelationship model (source/target type+id, relationship_type, metadata) - BFS Graph-Traversal (bidirektional, konfigurierbare Tiefe) - GraphRAGSearchProvider im unified_search registriert ### 5.8 Subagents / Multi-Agent: - AgentCoordinator Klasse (create_subtask, wait_for_subtask, aggregate, cancel) - AgentSubtask model + migration 0002_agent_subtasks.sql - 6 neue API Endpoints für Subtask-Management - Tools in AI tool registry registriert ### 5.9 External Agent API: - external_api.py: POST /run, GET /status, POST /stream (SSE) - Bearer API Token Authentifizierung - Rate Limiting: 10 req/min per token ### Verifikation: - py_compile: alle neuen Dateien OK ✅ - Health Check: 200 ✅, Login: 200 ✅ - 3 neue Plugins in main.py registriert --- ## 2026-08-04 — Cleanup **Commit:** 157e454, aaf2784 ### Gelöscht: - 34 alte Plan-Dateien (SANIERUNGS_FORTSCHRITT.md, UMBAU_PLAN.md, FIX-PLAN.md, etc.) - dump.rdb, templates/ (Jinja2 HTML), frontend/test_report.md - .a0/current_status.md und next_steps.md aktualisiert --- ## Ältere Einträge (archiviert) ### 2026-07-25 — P1-4: Transactional Outbox — COMPLETE ### 2026-06-29 — T03: Plugin System Framework — COMPLETE ### 2026-06-29 — T09: KI-Copilot API + Workflow Engine — COMPLETE ### 2026-06-29 — T07a: Frontend Core SPA — COMPLETE ### 2026-06-29 — T07b: Frontend Feature Pages — COMPLETE ### 2026-06-29 — T04: DMS Plugin Backend — COMPLETE ### 2026-06-29 — T11: Tags + Permissions + Entity Links — COMPLETE ### 2026-06-30 — T05: Calendar Plugin Backend — COMPLETE ### 2026-06-30 — T06: Test Fixes — COMPLETE ### 2026-07-01 — T06: Mail Plugin Backend — COMPLETE ### 2026-07-01 — T08a: Frontend DMS + Tags + Permissions UI — COMPLETE ### 2026-07-01 — T08c: Frontend Mail + Global Search UI — COMPLETE