docs: 117 Architektur-Fehler (ARCH-001 bis ARCH-117) durch systematisches Code-Review dokumentiert

This commit is contained in:
Agent Zero
2026-08-22 22:39:53 +02:00
parent e5c8b7beba
commit dc699bee86
+78
View File
@@ -1436,3 +1436,81 @@ Playwright E2E: 10 passed, 24 failed (BUG-011/012/013 — Mock-Daten und data-te
- **Problem:** `registerItems` setzt `activePlugin: plugin` automatisch. Wenn mehrere Plugins gleichzeitig registrieren, gewinnt das letzte. Sollte separaten setActivePlugin Call erfordern.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-105: core/approval.py — Model in core/ statt models/
- **Datei:** app/core/approval.py:38
- **Problem:** ApprovalRequest Model ist in core/ definiert, nicht in models/. Unübliche Platzierung, inkonsistent mit anderen Models.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-106: core/job_registry.py — _registry nicht thread-safe
- **Datei:** app/core/job_registry.py:22
- **Problem:** `_registry: dict[str, JobFunc] = {}` — globales dict ohne Locks. Bei gleichzeitigen Registrierungen kann es zu Race Conditions kommen.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-107: core/backup_job.py — _BACKUP_SCRIPT Pfad hardcoded
- **Datei:** app/core/backup_job.py:18-21
- **Problem:** Pfad zu backup.py wird mit os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) konstruiert. Sollte über Settings konfigurierbar sein.
- **Schwertegrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-108: core/sensitive_data.py — SENSITIVE_FIELDS statisch
- **Datei:** app/core/sensitive_data.py:22-40
- **Problem:** SENSITIVE_FIELDS ist ein statisches dict. Neue Plugin-Entities werden nicht automatisch erfasst.
- **Schweregrad:** Medium
- **Status:** ⏳ Nicht gefixt
### ARCH-109: core/monitoring.py — REGISTRY globale Variable
- **Datei:** app/core/monitoring.py:18
- **Problem:** `REGISTRY = CollectorRegistry()` — globale Variable, nicht thread-safe.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-110: core/pagination.py — approximate_count ungenau
- **Datei:** app/core/pagination.py:22
- **Problem:** approximate_count liest pg_class.reltuples — kann ungenau sein bei seltenen ANALYZE/VACUUM. Wird für Pagination verwendet → falsche Seitenzahlen.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-111: core/plugin_error_handler.py — delattr __wrapped__ erschwert Debugging
- **Datei:** app/core/plugin_error_handler.py:35
- **Problem:** `delattr(wrapper, '__wrapped__')` löscht __wrapped__ Attribut. Debugging-Tools die __wrapped__ verwenden um Original-Funktion zu finden, funktionieren nicht mehr.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-112: core/restore_registry.py — _DEFAULT_EXCLUDED statisch
- **Datei:** app/core/restore_registry.py:24-31
- **Problem:** _DEFAULT_EXCLUDED ist statisch. Neue Felder (z.B. indexed_at, content_tsv) werden nicht automatisch ausgeschlossen.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-113: core/history_hooks.py — register_history_hooks ohne Duplikatsprüfung
- **Datei:** app/core/history_hooks.py:30
- **Problem:** register_history_hooks registriert Hooks ohne Duplikatsprüfung. Bei mehrfachem Aufruf (z.B. pro Tenant) werden Hooks doppelt registriert.
- **Schweregrad:** Medium
- **Status:** ⏳ Nicht gefixt
### ARCH-114: core/state_machine.py — contact_state_machine erlaubt Überspringen von 'qualified'
- **Datei:** app/core/state_machine.py:42
- **Problem:** `"lead": ["qualified", "customer", "inactive"]` — erlaubt direkten Übergang von lead → customer ohne qualified. Business-Logik fraglich.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-115: core/principals.py — ContextVar nicht in Worker-Jobs verfügbar
- **Datei:** app/core/principals.py:25
- **Problem:** ContextVar ist async-safe aber nicht serialisierbar. Bei Worker-Jobs (ARQ) ist der Context nicht verfügbar → principals müssen neu geladen werden.
- **Schweregrad:** Low
- **Status:** ⏳ Nicht gefixt
### ARCH-116: core/ws_pubsub.py — subscribe_to_channel ohne Error-Handling
- **Datei:** app/core/ws_pubsub.py:25
- **Problem:** subscribe_to_channel erstellt asyncio.Task ohne Error-Handling. Task kann still fehlschlagen wenn Redis nicht verfügbar ist.
- **Schweregrad:** Medium
- **Status:** ⏳ Nicht gefixt
### ARCH-117: core/ws_helpers.py — authenticate_ws prüft nicht auf deaktivierte Plugins
- **Datei:** app/core/ws_helpers.py:25-45
- **Problem:** authenticate_ws authentifiziert User aber prüft nicht ob das Plugin (kommunikation) aktiv ist. WebSocket bleibt offen auch wenn Plugin deaktiviert ist.
- **Schweregrad:** Medium
- **Status:** ⏳ Nicht gefixt