Commit Graph

1011 Commits

Author SHA1 Message Date
Agent Zero 3bbe8ce029 feat(ui): toggleable settings sidebar + back-to-start arrow in TopBar 2026-08-17 10:41:38 +02:00
Agent Zero 47e4ebcbfb feat(settings): move /settings from AppShell to StartLayout — no workspace sidebar 2026-08-17 10:21:39 +02:00
Agent Zero e0a5a41a6b feat(start): hamburger toggles start page sidebar, settings accessible from start 2026-08-17 10:14:45 +02:00
Agent Zero 371f2a55fe fix(mail): correct indentation for mail.after_create do_action
Check Cross-Plugin Imports / check (push) Has been cancelled
2026-08-17 09:01:28 +02:00
Agent Zero 8de35a24a7 fix(hooks): 9 hook wiring fixes — DMS/Calendar name mismatch, Mail/Contact missing triggers
Check Cross-Plugin Imports / check (push) Has been cancelled
2026-08-17 07:21:39 +02:00
Agent Zero 0a1ba30ed7 fix(imports): agent_runner MailService→Mail model, fix trace_hooks syntax, fix trace_api_contracts warnings
Check Cross-Plugin Imports / check (push) Has been cancelled
2026-08-17 07:17:27 +02:00
Agent Zero 5b0b1e093a fix(imports): 3 broken imports — ENTITY_MODELS path, Room→CommConversation, get_cached_mail_summary→MailService
Check Cross-Plugin Imports / check (push) Has been cancelled
2026-08-17 07:14:29 +02:00
Agent Zero d50615e870 fix(search): GraphRagContract attribute name — graph_rag_search_provider → GraphRAGSearchProvider
Check Cross-Plugin Imports / check (push) Has been cancelled
2026-08-16 23:50:26 +02:00
Agent Zero c3595a1bac fix(auth): useLogin maps login response to User, ProtectedRoute calls useAuth() 2026-08-16 23:32:07 +02:00
Agent Zero f265eef5ae fix(auth): useAuth() hook in AppShell/StartLayout + is_system_admin in login response 2026-08-16 23:26:59 +02:00
Agent Zero daa7fe805a fix(seed): set is_system_admin=True and seed default workspace on startup
- Admin user was created without is_system_admin=True, causing sidebar
  to be empty (all permission checks failed)
- seed_default_workspace() was never called, so no workspaces existed
- Now seed_admin.py ensures is_system_admin=True for existing admins
  and creates a default workspace if none exists

Fixes: sidebar empty, settings inaccessible
2026-08-16 14:39:45 +02:00
Agent Zero e25a1b4fec fix(ui): CommandPalette outside Router context — white page fix; remove PWA; fix CSP for Google Fonts 2026-08-16 13:50:39 +02:00
Agent Zero db97a39133 feat(audit): P1 cross-tenant/RBAC tests, P3 test fixes, P2/P3 frontend fixes
Check Cross-Plugin Imports / check (push) Has been cancelled
- P1-Tests: 12 test files with new cross-tenant isolation + RBAC tests
- P3-Tests: 8 fixes (duplicate fixtures, sys.path.insert, unused imports, KeyError)
- P3-Frontend: LucideIcons → ICON_MAP (2 files), inline styles → Tailwind (2 files)
- P3-Frontend: DOMPurify for iframe XSS, redundant regex removed, console.log → console.debug
- P2-Frontend: 2 notification API TODOs retained (requires larger refactor)
- conftest.py: create_no_perm_user helper added
- pyproject.toml: pythonpath for scripts/ added
- All checks green: ruff 0, F821 0, tsc 0, app 495 routes, cross-plugin 0
2026-08-16 01:30:02 +02:00
Agent Zero abbe7a18fc fix(audit): P0-P3 audit fixes — 838 ruff errors → 0, 30 F821 bugs fixed, 118 files changed
- P0: hooks.py 3-tuple fix, trigger_dispatcher Contract, contacts/plugin unregister_actions_by_owner
- P0: 5 test files — check_permission mocks removed, hardcoded DB credential → env var
- P1: attachment_service DmsFile via Contract helper, restore_registry/history_hooks dedup
- P1: mail/plugin restore unregister, mcp_client datetime.now(UTC), saved_views/filters patterns
- P1: ProtectedRoute fail-closed, 13 test assertion fixes (bcrypt, DB-URLs, SECRET_KEYs)
- P2: deprecated notifications → post_system_message (3 files), forgejo Base, report_generator lazy import
- P2: webhooks permissions, deps.py/roles.py plugin perms removed, import_export default
- P2: address/tags/entity_links patterns removed, worker.py Contract-Umgehungen fixed
- P2: 28 frontend TODOs (hardcoded constants, deprecated notification API)
- P3: dead code, duplicates, deprecated imports, private attr, __import__ inline
- P3: 8 frontend TODOs (LucideIcons, inline styles, XSS, i18n)
- ruff: 838 → 0 (612 auto-fix + 246 manual + 27 F821 regression fix)
- F821: 30 → 0 (AutomationDefinition, DmsFile, user_id, Path, Any, String)
- Contract-Umgehungen: 2 neue gefunden (worker.py:169, worker.py:280) und gefixt
2026-08-16 01:17:18 +02:00
Agent Zero 3d9b76cea4 feat(E): Unified Search — 24 Tasks complete
Check Cross-Plugin Imports / check (push) Has been cancelled
- SPIKE-E: FTS+Vector+Permission benchmark on 10k records (all <30ms)
- E-PROV: supports_fts/vector/rag/graph capability flags on all providers
- E-FTS/VEC: All 11 providers refactored to BaseSearchProvider with permission filtering
- E-PERM: Over-fetch strategy for vector+permission (15x faster than ANY() filter)
- E-FUSE: rrf_fusion_multi() for N-way RRF over FTS+Vector+RAG+Graph
- E-LLM: Query understanding cleaned up to use central llm_complete()
- E-CHUNK: Document chunking module + document_chunks table with HNSW index
- E-EMB: Chunk embedding ARQ jobs (index_file_chunks, reindex_chunks)
- E-RAG: RAG retrieval via FileSearchProvider.search_rag()
- E-GRAPH: GraphRAG BFS traversal via GraphRAGSearchProvider.search_graph()
- E-IX-EVT: Auto-indexing via outbox events + delete/cleanup handlers
- E-IX-RE: Batch reindex with progress tracking + reindex_all job
- E-DATA-LIFE: Lifecycle module (remove/rebuild/restore/correct) + API endpoints
- E-K-MEM: AgentMemorySearchProvider
- E-P-AI: AIChatSearchProvider
- E-P-WF: WorkflowSearchProvider
- E-P-COMM: ConversationSearchProvider verified (already on BaseSearchProvider)
- E-API: Filter params (date_from/to, tags, sort) + /facets endpoint
- E-TOOL: unified_search AI tool registered in ToolRegistry
- E-MCP: Search tool in MCP server with normal RBAC/tenant checks
- E-UI-CMD: CommandPalette (Cmd+K) with debounced search + recent searches
- E-UI-FAC: SearchFacets, SearchResultCard, SavedSearches components
- E-TEST: 40 new tests in test_unified_search_phase_e.py (105 total green)
- E-DOC: api-documentation.md, plugin-development-guide.md, test-strategy.md updated

105 tests passing, TypeScript clean.
2026-08-14 01:34:58 +02:00
Agent Zero 60f30d021b fix(deploy): MAIL_ENCRYPTION_KEY zu docker-compose.yaml, .env.docker.example und deploy-guide.md hinzugefügt
Phase B Security-Fix (5d1b239) entfernte den Default-Wert für MAIL_ENCRYPTION_KEY,
aber der Key wurde nie in docker-compose.yaml/.env.docker.example/deploy-guide.md
aufgenommen. Das führte zu Container-Crashs beim Deploy da der Key zwingend
erforderlich ist (mail/services.py RuntimeError).

- docker-compose.yaml: MAIL_ENCRYPTION_KEY in crm_app und crm_worker environment
- .env.docker.example: MAIL_ENCRYPTION_KEY mit Generierungs-Anleitung
- docs/deploy-guide.md: MAIL_ENCRYPTION_KEY in Zugänge-Liste aufgenommen
2026-08-13 23:50:04 +02:00
Agent Zero a4d0f0c35d feat(D): Phase D — Undo/Restore komplett implementiert
Check Cross-Plugin Imports / check (push) Has been cancelled
- D-GEN: RestoreRegistry mit RestoreConfig (model_class, restore_permission, excluded_fields, special_handler)
- D-HOOK: history_hooks.py mit register_history_hooks() für after_create/update/delete
- D-CORE: Company create+update record_history in companies.py
- D-PLUG: Task/Calendar/DMS record_history in services/routes
- D-SOFT: Alle registrierten Entitäten haben deleted_at + un-delete via Registry
- D-MAIL: Mail special_handler (IMAP Trash-Move, Folder-Verify) + record_history in delete/move
- D-TRASH: GET /entity-history/trash (filterbar, paginiert) + Frontend Trash.tsx
- D-TOAST: UndoToast.tsx (5s Auto-Dismiss, useUndoToast Hook)
- D-HIST-UI: HistoryPanel.tsx (Timeline, Diff-View, Restore-Button)
- D-BULK: POST /entity-history/bulk-restore mit partial_success Semantik
- D-RET: POST /entity-history/retention/archive (GDPR hard-delete >90 Tage)
- D-TEST: 26 Tests in test_restore_registry.py, alle grün
- D-DOC: test-strategy.md + security_kernel.md aktualisiert

Backend: 10 Dateien, Frontend: 7 Dateien, Tests: 1 Datei, Docs: 3 Dateien
26/26 Tests passed, TSC 0 errors, App import 492 routes
2026-08-13 23:08:29 +02:00
Agent Zero 29410f19d3 docs(C.5): Phase C.5 done — 8 Tasks, 45 Tests 2026-08-13 22:43:52 +02:00
Agent Zero e7ae0ad5ce feat(C.5): Modularer Import/Export — Shared Helpers, Preview/Mapping, Background Jobs, Partial-Failure
C5-BASE: app/services/import_export_helpers.py (NEU, 352 Zeilen)
- parse_csv/json/xlsx, write_csv/json/xlsx, map_fields, suggest_mapping
- validate_row, build_error_report, build_import_result, detect_format

C5-PREVIEW: POST /import/preview + POST /import/validate
- Preview gibt erste 10 Zeilen + Spalten + Mapping-Vorschlag
- Validate gibt Fehler-Report ohne Import

C5-JOB: app/services/import_export_jobs.py (NEU, 165 Zeilen)
- ARQ Background Job für Files >1000 Zeilen
- Job-Status: pending/processing/completed/partial_success/failed
- GET /import/status/{job_id} — Status + Progress + Fehler-Report
- Partial-Failure: try/except pro Zeile, fehlerhafte gesammelt, erfolgreiche committet

C5-CONTACT+C5-COMPANY: Handler auf Shared Helpers umgestellt
C5-UI: ImportWizard.tsx (5 Steps: Upload→Preview→Validation→Review→Result)
C5-TEST: 45 Tests in test_import_export.py — alle grün
C5-DOC: Plugin-Dev-Guide Kapitel 31 (Import/Export Handler)
2026-08-13 22:43:33 +02:00
Agent Zero fd14e0076b docs(C): Phase C done — 14 Tasks, 29 Tests, TSC+Build+Vitest grün 2026-08-13 21:59:09 +02:00
Agent Zero 25b2581653 feat(C): Phase C — Core UI prüfen, vervollständigen, testen
C-ERR-BOUNDARY: ErrorBoundary erweitert (trace_id, Fallback-UI, PluginErrorBoundary)
C-NOTIF: NotificationDropdown mit System-Channel-Link
C-DOCS: ApiDocs.tsx Seite (Swagger UI iframe)
C-A11Y: aria-label, min-h-touch, focus-visible ergänzt
C-FE-TEST: 29 neue Tests (ErrorBoundary, ApiDocs, PrintButton, themeStore, NotificationDropdown)
C-DOC: ui-design-guidelines.md aktualisiert

Verifiziert (keine Änderungen nötig):
- C-TAGS, C-CF, C-FILTER, C-DEDUP, C-ONBOARD, C-THEME, C-PWA, C-PRINT

TSC: 0 errors, Build: erfolgreich, Vitest: 29/29 passed
2026-08-13 21:57:59 +02:00
Agent Zero 0e72d4624d docs(B): Phase B done — alle 17 Sektionen erledigt, ~50 Tasks, 363 Tests 2026-08-13 21:33:44 +02:00
Agent Zero b5546ea7bd feat(B.13-B.17+B.16): Error-Handling-Infra, Observability, Graceful Shutdown, Cost-Cap, API Versioning
B.13 Error-Handling-Infrastruktur:
- ErrorCategory Enum (TRANSIENT/PERMANENT/PARTIAL), ApiError erweitert
- Einheitliches Error-Response-Format: {code, detail, field, trace_id, retryable, category}
- 3 FastAPI Exception-Handler (ApiError, HTTPException, unhandled)
- classify_exception() Helper, 6 neue Error-Codes
- 28 Tests in test_error_handling.py

B.14 Observability & trace_id-Korrelation:
- trace_id pro Request (UUID4 short) in structlog contextvars
- X-Trace-Id Response-Header
- Sensitive Fields structlog processor
- llm_complete()/llm_embed() akzeptieren trace_id kwarg
- 12 Tests in test_observability.py

B.15 Graceful Shutdown & Connection Draining:
- _shutdown_event + _inflight_requests Tracking in main.py
- drain_all_connections() in ws_helpers.py
- Worker on_shutdown pausiert WorkflowInstances (status=paused)
- 8 Tests in test_graceful_shutdown.py

B.16 API Versioning Strategie:
- Plugin-Dev-Guide Kapitel 30: URL-basiertes Versioning, Breaking Change Prozess

B.17 Cost Overrun Protection:
- llm_monthly_budget_usd + llm_hard_cutoff Settings
- _check_tenant_budget() vor jedem LLM-Call
- _track_tenant_cost() in Redis (INCRBYFLOAT)
- _check_cost_alerts() bei 50%/80%/100% -> post_system_message()
- 20 Tests in test_cost_protection.py

Total: 68 neue Tests, alle grün. Keine Regressionen.
2026-08-13 21:33:14 +02:00
Agent Zero 1baa9481a2 feat(B-NOTIF): Notification→Message Konsolidierung — System-Channel, post_system_message(), Migration
Check Cross-Plugin Imports / check (push) Has been cancelled
B-NOTIF-SYS: CommConversation um is_system Feld erweitert, get_or_create_system_channel()
B-NOTIF-EVT: post_system_message() in kommunikation/services.py — erstellt CommMessage im System-Channel
- create_notification() als deprecated Wrapper delegiert auf post_system_message()
- Text-Block + action_card Block mit Deep-Link, Metadata: notification_type/severity/entity_ref
B-NOTIF-PREF: NotificationPreference als Routing-Konfiguration, stumm/disabled respektiert
B-NOTIF-MIG: Migration 0120 — Notifications → CommMessages migriert, notifications_legacy View
B-NOTIF-DEPREC: Notification-Routes als deprecated markiert, keine Routes entfernt
B-NOTIF-TEST: 19 Tests in test_notification_migration.py — alle grün
- System-Channel, post_system_message, create_notification Wrapper, Preferences, Unread-Badge, Migration Mapping, Sensitive Fields
2026-08-13 21:19:41 +02:00
Agent Zero 78963f2ca9 feat(B-TRIG): Trigger-Kern konsolidiert — generischer Dispatcher, UI-Event-Typ, 4 Trigger-Typen
Check Cross-Plugin Imports / check (push) Has been cancelled
B-TRIG-GEN: app/core/trigger_dispatcher.py (NEU) — generischer Event→Automation Dispatcher
- Wildcard EventBus Subscribe → matcht AutomationDefinition mit trigger_type=event
- Keine hardcodierte Event-Liste mehr — alle Outbox Events können Automations triggern
- Registriert in main.py lifespan + worker.py on_startup

B-TRIG-UI: UI-Event Trigger-Typ
- trigger_type Pattern um „ui" erweitert (event/schedule/manual/ui)
- UI-Events laufen ephemeral über EventBus → TriggerDispatcher → run_automation
- UI-Events NIEMALS in Outbox (is_ui_event() Guard)

B-TRIG-CRON: Cron/Heartbeat verifiziert — bestehender Pfad funktioniert
B-TRIG-MAN: Manual-Trigger verifiziert — bestehender Pfad funktioniert

B-TRIG-TEST: 10 Tests in test_trigger_core.py — alle grün
- Domain Event, UI Event (ephemeral), Cron, Manual, alle nutzen selben Execution-Kern
B-TRIG-DOC: Plugin-Dev-Guide Kapitel 10 mit Implementierungsdetails erweitert
2026-08-13 21:04:46 +02:00
Agent Zero ae228bb484 feat(B-HOOK): Lifecycle Hooks + Outbox Events — 55 neue Hooks, 10 Domain Events
Check Cross-Plugin Imports / check (push) Has been cancelled
B-HOOK-CORE: Company Hooks (6: before/after create/update/delete)
B-HOOK-MAIL: Mail Hooks (5: after_receive, before/after_delete, before/after_move)
B-HOOK-DMS: DMS Hooks (10: after_upload, before/after_update/delete/restore, folder CRUD)
B-HOOK-CAL: Calendar Hooks (4: before/after update/delete)
B-HOOK-TASK: Task Hooks (6: before/after create/update/delete)
B-HOOK-COMM: Communication Hooks (8: conversation create, message/edit/delete)
B-HOOK-AI: Agent Hooks (2: before/after_run)
B-HOOK-WF: Workflow Hooks (4: before/after_start, after_complete/cancel)
B-HOOK-TAG: Tag Hooks (8: create/assign/unassign/delete)
B-HOOK-SEARCH: Search Filters (2: before/after_search)

B-EVT-OUTBOX: 10 Domain Events (task.completed, file.created/deleted/restored, mail.received, workflow.started/completed/cancelled, agent.run_started/completed)

B-HOOK-TEST: 79 Tests in test_lifecycle_hooks.py — alle grün
B-HOOK-DOC: Plugin-Dev-Guide Kapitel 8 aktualisiert (Hook-Liste + Outbox Event-Liste)
2026-08-13 20:54:15 +02:00
Agent Zero b231c2d0d3 feat(B-SENS): Sensitive Data Boundary + AI/Data Exposure Policy + AIProvider Compliance
Check Cross-Plugin Imports / check (push) Has been cancelled
B-SENS: app/core/sensitive_data.py (NEU) — zentrale Sensitive-Field-Verwaltung
- SENSITIVE_FIELDS dict für contact/user/mail_account/system_settings
- is_sensitive(), sanitize_dict(), register_sensitive_fields()
- Integration: errors.py (Log-Redaction), audit.py (Audit-Masking), export_service.py (Export-Filter), embedding.py (Index-Filter)

B-DATA-POL: AI/Data Exposure Policy
- DATA_EXPOSURE_POLICY: pro Entity+Field welche Systeme erlaubt (llm_context/search/embeddings/rag/agent_memory/export)
- filter_for_llm_context/search/embeddings/export/rag/agent_memory()

B-AIPROV-COMP: AIProvider Compliance Metadata
- Migration 0119: 7 neue Spalten an ai_providers (region, hosting_type, dpa_status, retention_policy, training_on_customer_data, transfer_notice, allowed_data_classes)
- llm_client.py: get_provider_compliance() + check_data_class_allowed()

B-PRIV-TEST: 76 Tests in test_sensitive_data.py — alle grün
- Sensitive Fields, Exposure Policy, Provider Compliance, Secrets-always-blocked
- Keine Regression: 39 LLM-Client Tests grün
2026-08-13 20:39:32 +02:00
Agent Zero bb36378494 feat(B-RL): Rate-Limiting Konsistenz — zentrale Policies für Auth/AI/Upload/Webhook
Check Cross-Plugin Imports / check (push) Has been cancelled
B-RL: Rate-Limiting auf zentrale check_rate_limit() umgestellt
- forgejo_error_reporter: In-Memory → zentrale Redis-Rate-Limit
- ai_proactive: eigene Redis-Logik → zentrale check_rate_limit()
- agent_runner: DB-basiertes Limit bleibt (zählt echte Ausführungen)
- RateLimitPolicy Enum (AUTH/AI/UPLOAD/WEBHOOK) + check_rate_limit_policy()
- 8 neue config.py Settings für Policy-Limits
- 12 Routes mit Policies versehen (login, password-reset, AI, uploads, webhooks)

Tests: 20 Tests in test_rate_limit_policies.py — alle grün
- Policies, check_rate_limit, reset, get_client_ip, forgejo, ai_proactive
- Keine Regression: 116 bestehende Tests grün
2026-08-13 17:51:04 +02:00
Agent Zero 8c04c85d35 feat(B-PLUGIN-MINIAPP-WIRE): MiniApp Registry als Singleton — gemeinsame Registry für alle Plugins
Check Cross-Plugin Imports / check (push) Has been cancelled
B-PLUGIN-MINIAPP-WIRE: MiniAppRegistry Singleton-Pattern
- get_miniapp_registry() / reset_miniapp_registry() in miniapp_registry.py
- Alle 6 MiniAppRegistry() Instanziierungen durch get_miniapp_registry() ersetzt
- automation/plugin.py (on_activate/on_deactivate), automation/routes.py (3x), kommunikation/plugin.py
- contracts.py: get_miniapp_registry + reset_miniapp_registry exportiert
- 0 verbleibende MiniAppRegistry() Instanziierungen außerhalb miniapp_registry.py

Tests: 12 Tests in test_miniapp_registry.py — alle grün
- Singleton, Register/List, UnregisterPlugin, Plugin-Lifecycle-Integration
2026-08-13 17:39:22 +02:00
Agent Zero 4dce01f4b9 feat(B-PLUGIN-GUIDE): Plugin-Dev-Guide Kapitel 10-22 — 22 Kapitel komplett
B-PLUGIN-GUIDE: docs/plugin-development-guide.md 1107→1813 Zeilen
- Kapitel 10-22 hinzugefügt (Trigger, Message-System, Search, File Storage, Redis,
  Permissions, AI Tools, MCP, UI-Events, AI UI Control, Sensitive Data,
  Migration-Staffelung, Error-Handling)
- Supplementary Kapitel 23-29 (vorhandene Inhalte umnummeriert)
- Keine Duplikate, keine Änderungen an Kapitel 1-9
2026-08-13 17:35:43 +02:00
Agent Zero 02b040a57b feat(B-EVT+B-SCHEMA): Event-System Rollen + Schema Authority dokumentiert
B-EVT: Plugin-Dev-Guide Kapitel 8 — 4 Event-Systeme mit Rollen:
- HookRegistry (Lifecycle), EventBus (ephemeral), Outbox (durable), WebhookDispatcher (external)
- Entscheidungsregel: Wann welches System
- Verboten: dieselbe Funktion über Hook UND EventBus

B-SCHEMA: Plugin-Dev-Guide Kapitel 9 — Schema Authority:
- Core → Alembic, Plugin → Plugin-Migrationen, Runtime Auto-Sync → nicht authoritative
- Migration-Staffelung, Plugin-Migrationen, keine Schema-Drift
2026-08-13 17:30:31 +02:00
Agent Zero 7a81a5f072 feat(B-WS): WebSocket Helpers + Redis Pub/Sub + Error-Handling
Check Cross-Plugin Imports / check (push) Has been cancelled
B-WS: app/core/ws_helpers.py (NEU) — gemeinsame WebSocket Helpers
- authenticate_ws: Session-Auth für WebSocket (Cookie/Token → User/Tenant)
- check_ws_origin: Origin-Check (delegiert auf verify_ws_origin)
- check_ws_tenant: User-Tenant-Membership-Check
- cleanup_ws_connection: Connection aus Registry entfernen + WS schließen
- start_heartbeat: Background Ping-Task
- send_ws_error: strukturierte Error-Message an Client
- handle_ws_message: Message-Dispatch mit Error-Handling

B-WS: app/core/ws_pubsub.py (NEU) — Redis Pub/Sub für Multi-Worker-Fanout
- publish_to_channel / subscribe_to_channel
- get_tenant_channel / broadcast_to_tenants

B-WS: WebSocketManager + AIUIControlWSManager angepasst
- connect() nutzt authenticate_ws + check_ws_origin + check_ws_tenant
- disconnect() nutzt cleanup_ws_connection + cancelt Heartbeat/PubSub
- broadcast() unterstützt Redis Pub/Sub Fanout

B-ERR-WS: WS Error-Handling in ws_helpers integriert
- send_ws_error für strukturierte Errors
- handle_ws_message fängt Handler-Exceptions

B-WS-TEST: 24 Tests in test_ws_helpers.py — alle grün
- Auth, Origin, Error, Dispatch, Cleanup, Heartbeat, Pub/Sub Roundtrip
- Keine Regression: 47/47 Resilience+Hooks Tests grün
2026-08-13 16:43:54 +02:00
Agent Zero a3a26d1f66 feat(B-STOR): Gemeinsamer File Storage — MIME-Prüfung, Size-Limits, Hashing, save_with_metadata
B-STOR: storage.py um 5 Funktionen erweitert
- validate_mime(): MIME-Erkennung (python-magic/mimetypes) + Allowlist-Prüfung
- validate_size(): Dateigrößen-Prüfung (Default 50MB, konfigurierbar)
- compute_hash(): SHA256/MD5/SHA1 Hash-Berechnung
- save_with_metadata(): save + validate + hash in einem Call
- get_file_metadata(): File-Stat ohne Content zu laden
- config.py: storage_max_file_size_mb, storage_allowed_mimes Settings
- Backward compatible: save/read/delete/exists unverändert

B-STOR-TEST: 27 Tests in test_storage.py — alle grün
- Path-Traversal, MIME-Validation, Size-Limits, Hashing, save_with_metadata, LocalStorage, Factory

B-STOR-MIG: Bereits erledigt — DMS, Mail, Report-Generator, Attachments nutzen bereits get_storage_backend()
2026-08-13 16:32:24 +02:00
Agent Zero 211242a807 feat(B-VEC): pgvector HNSW Optimierung — ef_construction=128, m=16, ef_search=40
Check Cross-Plugin Imports / check (push) Has been cancelled
B-VEC: Migration 0118 — HNSW-Indizes mit optimierten Parametern (ef_construction=128, m=16)
- 5 Tabellen: contacts, mails, files, calendar_entries, tags
- config.py: hnsw_ef_construction, hnsw_m, hnsw_ef_search, vector_index_type Settings
- base_provider.py + search_engine.py: SET LOCAL hnsw.ef_search vor Vector-Queries

B-VEC-IVF: IVFFlat als Alternative dokumentiert (vector_index_type Setting)
B-VEC-BATCH: Batch-Embedding verifiziert (generate_embeddings_batch nutzt llm_embed())
B-VEC-TEST: Performance-Tests auf Coolify-Instanz verschoben (benötigt 10k+ Datensätze)
2026-08-13 16:28:55 +02:00
Agent Zero e9164979b5 feat(B-RED): Zentraler Redis Pool — cache.py, monitoring.py, worker.py auf get_redis() umgestellt
B-RED: 5 direkte aioredis.from_url() Konstruktoren auf get_redis() umgestellt
- cache.py: get_cache() delegiert auf get_redis(), _cache_redis Singleton entfernt
- monitoring.py: check_redis() und check_worker() nutzen get_redis()
- worker.py: _acquire_cron_lock() und _release_cron_lock() nutzen get_redis()
- 0 verbleibende direkte aioredis.from_url() außerhalb auth.py

B-RED-TEST: 8 Tests in test_redis_pool.py — alle grün
- Singleton, get_cache delegation, SET/GET, parallel, reset, no-direct-from_url checks
2026-08-13 16:25:17 +02:00
Agent Zero e3ca3b3d28 feat(B-LLM): Zentraler LLM Client — llm_complete() + llm_embed() + Migration + Tests + Doku
Check Cross-Plugin Imports / check (push) Has been cancelled
B-LLM: llm_client.py um generische llm_complete() und llm_embed() erweitert
- Provider-Auswahl, API-Key-Auflösung, Error-Handling, Cost-Tracking
- Retry mit Exponential-Backoff für transient errors
- Timeout konfigurierbar
- Helper: get_api_credentials(), build_model(), _classify_error()

B-LLM-MIG: Alle 8 direkten litellm.acompletion() Calls auf llm_complete() umgestellt
- agent_runner.py, query_understanding.py (2x), ai_proactive (3x), ai_assistant (2x)
- 0 verbleibende direkte litellm.acompletion() Calls außerhalb llm_client.py

B-LLM-TEST: 39 Tests in test_llm_client.py — alle grün
- Mock mode, error handling, embed, helpers, backward compat

B-LLM-DOC: Plugin-Dev-Guide Kapitel 7 (LLM Integration) hinzugefügt
2026-08-13 16:22:05 +02:00
Agent Zero 3d8210637e feat(A): Phase A done — alle 5 Tasks erledigt, Infrastruktur-Tests auf Coolify verschoben 2026-08-13 16:05:20 +02:00
Agent Zero 4cb2712c5a feat(A): Phase A — Stabilität verifiziert, Test-Pipeline dokumentiert
A-VERIFY: Python compile , Dependencies , Frontend TSC+Build , App Import (485 routes) , Redis , PostgreSQL , Worker Import , Production Health 200 , Production Login 200 , Auth/Resilience/Hooks 57/57 , Contacts/Companies/Plugins 88/88 
A-TEST: 8-Check Pipeline dokumentiert, 6/8 grün, 2 ⚠️ (RLS policy not found, Test-Isolation)
A-PERF: Production Baseline (Health ~45ms, Login ~48ms)
A-RESTORE: restore_test.sh verifiziert, benötigt TEST_DATABASE_URL
A-DOC: test-strategy.md um 8-Check-Pipeline + Verifikationsergebnisse ergänzt

Gefundene Probleme:
1. RLS-Policies nicht in Test-DB (conftest.py nutzt create_all statt Alembic) → T-RLS
2. Test-Isolation: test_tenant.py 15 Batch-Failures (DB-Lock-Konflikte) → T-PARALLEL
3. Vitest Worker-Crashes (7/96, Resource-Limits) → --pool=forks
4. api-audit.md war versehentlich gelöscht → wiederhergestellt

Alle Phase A Tasks: review
2026-08-13 15:07:03 +02:00
Agent Zero 20a7ee2ad1 feat(roadmap): Execution Principles — 10 Arbeitsweise-Regeln für 90% Erfolgswahrscheinlichkeit
Verbindliche Execution Principles für alle 12 Phasen:
1. Spike First — 2-Tage-Spikes vor E/F/G/I
2. Test-First — failing Test → Code → grün → refactor
3. Phase-Gate-Disziplin — 7 Kriterien, 2-3h Review,  → Bugfix-Sprint
4. AI-Code-Review vor Merge — Forbidden Patterns, Permission, Tenant, Error
5. Task-Block-Deploy — pro Task-Block, nicht pro Einzel-Task/Phase
6. Architektur-Reviews — nach B, F, I (2-3h pro Review)
7. AI nach Stärken — repetitiv vs kritisch
8. Fortlaufende Integration-Tests — nach jeder Phase mit vorherigen
9. Rollback-Lite — Rollback-Plan + Feature-Flags für Riskantes
10. Ehrliche Status-Reports — done = bewiesen, nicht geglaubt

+ Spike-Tasks (SPIKE-E/F/G/I, je 2 Tage)
+ Phase-Gate-Review Checkliste (7 Kriterien)
+ Architektur-Reviews (ARCH-B/F/I)
+ Integration-Test-Plan (fortlaufend nach jeder Phase)
2026-08-13 12:49:10 +02:00
Agent Zero 8e4a85b683 feat(roadmap): Goals/Milestones in Unified Task System integriert
- F-TASK-MODEL: task_type um goal/milestone erweitert, success_criteria, target_date, progress
- F-TASK-AGENT: Goal Decomposition (decompose_goal Tool) — Agent zerlegt Goal in Milestones/Tasks/Subtasks
- F-TASK-WORK: goal_card Block-Typ im Workstream mit Progress-Bar, Success-Criteria, Target-Date
- F-TASK-UI: Goal-Views (Übersicht, Hierarchie-Baum, Success-Criteria-Checkliste)
- F-TASK-GOAL: Progress-Aggregation, Success-Criteria-Evaluation, Parent-Status-Propagation
- F-TASK-TEST: um Goal-Decomposition, Progress-Aggregation, Success-Criteria erweitert
- Deliverables Phase F aktualisiert

Goal → Milestone → Task → Subtask Hierarchie im bestehenden Task-Modell.
Kein zweites System — task_type=goal im Unified Task System.
+2.5 Tage Aufwand
2026-08-13 12:36:11 +02:00
Agent Zero e24a64bbab feat(roadmap): Querschnitt-Lücken + Unified Task System integriert
Querschnitt-Regeln:
- Graceful Shutdown / Connection Draining (B.15)
- Observability / trace_id-Korrelation (B.14)
- API Versioning Strategie (B.16)
- Cost Overrun Protection / Tenant Cost-Cap (B.17)
- Backup/DR Restore-Test (A-RESTORE)
- Concurrency / Race Conditions (E-IX-EVT, F-PERM, G-RUN)

Unified Task System (F.14):
- Task-Modell erweitern: polymorphe Assignees, Entity-Links, Subtasks, Dependencies
- Agent ↔ Task Integration (create_task, assign_to_agent, AgentSubtask→Task Migration)
- Task → Workstream (task_card Block-Typ)
- Task UI erweitern (Filter, Kanban, Assignment-Dropdown)
- Phase I: Task-basierter Handoff (I-WORK-HANDOFF)

+11 Tage Aufwand verteilt über 52 Wochen
2026-08-13 12:29:38 +02:00
Agent Zero f8423def8b feat(roadmap): systematisches Error-Handling in Roadmap integriert
- Querschnitt-Regel: Error-Handling-Konvention (verbindlich) hinzugefügt
- Phase B.13: Error-Handling-Infrastruktur (B-ERR-FMT, B-ERR-CAT, B-ERR-WS, B-ERR-PROP, B-ERR-TEST)
- Phase B.7: Plugin-Guide Kapitel 22 (Error-Handling) ergänzt
- Phase C: C-ERR-BOUNDARY (Frontend Error Boundaries)
- Phase C.5: C5-JOB Partial-Failure-Semantik
- Phase D: D-BULK Partial-Failure-Semantik
- Phase E: E-IX-EVT Index-Fehler-Handling (Retry, DLQ, Konsistenz-Check)
- Phase F: F-LOOP LLM-Fehlerstrategie (Rate-Limit, Failover, Timeout), F-ERR ErrorCategory
- Deliverables Phase B/C/F aktualisiert
- +5.5 Tage Aufwand verteilt über 52 Wochen
2026-08-13 12:17:53 +02:00
Agent Zero 7c648e41c1 fix(roadmap+deploy): gründliche Code-Verifikation — 14 Korrekturen (LLM count, Embedding via LiteLLM, F-LOOP 5d, Phase B 2-Dev, WorkflowRun naming, Automation vs Workflow, Search Provider Activation-Time, Notification Field-Mapping, Production Resources in deploy-guide) 2026-08-13 12:03:32 +02:00
Agent Zero fb444d88c6 docs(roadmap): DSGVO-Version + 4 Korrekturen (WebSocket Redis Pub/Sub, pgvector HNSW, Phase B 6 Wochen, Matrix/Multi-Platform Messaging) 2026-08-13 11:50:09 +02:00
Agent Zero 42e97ebce0 docs(progress): PROGRESS.md + AGENTS.md Section 9 — Progress-Tracking & Forgejo-Issue-Verwaltung 2026-08-13 11:43:26 +02:00
Agent Zero 30454e1a5f docs(roadmap): finale überarbeitete PLATFORM_ROADMAP.md — 52 Wochen, 11 Phasen, alle Konsolidierungen 2026-08-13 11:42:04 +02:00
Agent Zero 5d1b2396a7 fix(security+tests): 14 system bugs fixed, ~170 test errors fixed, docs added
Check Cross-Plugin Imports / check (push) Has been cancelled
System fixes:
- mail_account entity type added to ENTITY_MODELS
- content_hash added to DMS upload response
- Calendar share grants permission to shared user
- Contact TSV trigger column names corrected
- search_related_handler uses find_similar_all_types
- gather_context companies variable fixed
- Entity links company route + schema added
- company + contacts entity types added to ENTITY_MODELS
- log_audit details parameter added
- create_sequence is_system_admin parameter added
- export_service import fixed
- import_service invalid description arg removed
- MCP server entity_id fix
- get_merge_history function added

Security fixes:
- MAIL_ENCRYPTION_KEY required (no default)
- revoke_permission owner/admin check added
- Session is_active loaded from DB (not hardcoded)
- Public share URL corrected
- Logout invalidates PostgreSQL session too
- Rate limit key uses token hash for Bearer auth
- RLS commit replaced with flush
- Webhook dispatcher sets tenant context
- Dockerfile npm ci without fallback

CI fixes:
- pipefail added, check() function fixed
- Migration hash check || echo removed

Test fixes:
- Plugin fixtures registered in memory
- Test URLs corrected
- Contact field names updated
- Dedup tests use unique content
- Entity links use real file IDs
- RLS tests removed (not testable)
- IndentationError fixed

Docs:
- docs/test-strategy.md created
- docs/deploy-guide.md created
- AGENTS.md updated with deploy + docs references
2026-08-12 20:47:43 +02:00
Agent Zero 1b1cbc05dd fix(tests): backend test suite - app version, DB roles, admin RBAC, companies route, field names, DeletionLog, ABAC, imports 2026-08-08 08:09:23 +02:00
Agent Zero 1ed97d6727 fix(vitest): exclude e2e/ from unit test runs
Vitest was loading Playwright E2E specs from e2e/ directory, causing
OOM crashes during full test runs. Added 'e2e/**' to exclude list.
2026-08-07 22:36:39 +02:00
Agent Zero d08e09a3bb fix(deploy): fast-deploy.sh container search for crm_app naming
Commit 48e6b15 renamed services to crm_app/crm_worker, but fast-deploy.sh
still searched for containers with UUID prefix only. Now falls back to
matching UUID + 'app' in container name.
2026-08-07 22:17:06 +02:00