diff --git a/PROGRESS.md b/PROGRESS.md index 4f76a39..62a00a1 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -83,7 +83,11 @@ | D4-c | BUG-020 288 SQLi-Risiken: Cluster-Analyse → 10 f-string-SQL + 2 String-Konkatenationen; alle Interpolationen aus Whitelists (_TABLE_MAP, tables-Dicts mit Guard) oder int-Config (hnsw_ef_search) — kein User-Input-Fluss | ✅ Kein fixbares Finding; agent_memory type_filter statisch+parameterisiert; Triage in test-bugs.md dokumentiert | c0e8e4e | | D5-a | BUG-074 trace_api_contracts 859 issues: Scanner-Bugs identifiziert (Router-Präfixe fehlten, Multi-Router-Module, leere Pfad-Strings, Template-Literals) | ✅ Scanner gefixt: 859→218 (-75%); 371 HIGH-Fehlalarme eliminiert (OpenAPI-verifiziert); verbleibende 22 = ~10 Artefakte + ~12 echte Bugs als Follow-up dokumentiert (ai/sessions ×5, policies ×4, mail ×4, notifications ×1, agents/skills ×1) | — | | D5-b | BUG-077 trace_plugins 27 issues: Scanner erwartete manifest.py, Projekt-Konvention ist Inline-Manifest in plugin.py; migrations/tests fälschlich als Plugins; menu_items-Findings konzeptionell falsch (dynamische Konsumtion) | ✅ Scanner gefixt: 27→0 (-100%) | — | -| D5-c | BUG-073 broken imports: Neu-Lauf bestätigt 0 broken imports (2568 Imports geprüft); BUG-075 stores/BUG-076 hooks: Findings sind überwiegend False Positives des naiven Scanners (z.B. 'const'/'null' als Store-Member) | ✅ Dokumentiert; Scanner-Qualität als bekanntes Limit vermerkt | — | +| D5-c | BUG-073 broken imports: Neu-Lauf bestätigt 0 broken imports (2568 Imports geprüft); BUG-075 stores/BUG-076 hooks: Findings sind überwiegend False Positives des naiven Scanners (z.B. 'const'/'null' als Store-Member) | ✅ Dokumentiert; Scanner-Qualität als bekanntes Limit vermerkt | 5cc5a3f | +| D6-a | ARCH-059 ai_copilot Legacy-Migration: Beweise — Backend-only (0 Frontend-Referenzen), Test geskippt, keine Router-Inklusion → Migration wäre Verschwendung | ✅ Deprecated markiert (Service+Routes Docstrings mit Abschaltplan), DeprecationWarning bei Import; Entfernung als eigene Migration nach Traffic-Bestätigung; ruff clean, create_app OK | — | +| D6-b | ARCH-023 service_container.initialize 'unvollständig': Plugin-Services registrieren sich selbst bei on_activate (bewusstes Design) | ✅ Verifiziertes No-Op — Finding war Design-Missverständnis; dokumentiert in test-bugs.md | — | + +**Block D ABGESCHLOSSEN** (D1–D6) — D1: alle 9 Ziel-Suites grün; D2: DateTime/SQLITE-001; D3: ARCH-051/055/056/057 + systemischer Permission-Resolver-Bug + conftest-pgvector; D4: Security-Triage (ARCH-027 verifiziert, BUG-019 = 0 echte Secrets, BUG-020 kein fixbares Finding); D5: Scanner-Triage (api_contracts -75%, plugins -100%, 371 Fehlalarme eliminiert); D6: ai_copilot deprecated + ARCH-023 No-Op. Offene Follow-ups dokumentiert (~12 echte API-Bugs aus D5, IMAP-Mocking für Mail-Tests). Nächster Block: E (Production-Härtung). **Block A ABGESCHLOSSEN** — Gate A bestanden (32f63ad). **Block B ABGESCHLOSSEN** — Gate B bestanden (alle 5 Checks bewiesen). diff --git a/app/routes/ai_copilot.py b/app/routes/ai_copilot.py index afa6166..e28ff8a 100644 --- a/app/routes/ai_copilot.py +++ b/app/routes/ai_copilot.py @@ -1,4 +1,10 @@ -"""AI Copilot routes — query, execute, history.""" +"""AI Copilot routes — query, execute, history. + +.. deprecated:: Phase 2 (ARCH-059) + Legacy module, not wired into main.py and without frontend consumers. + Scheduled for removal together with app/services/ai_copilot_service.py + and the ``ai_conversations`` tables (see service docstring for plan). +""" from __future__ import annotations diff --git a/app/services/ai_copilot_service.py b/app/services/ai_copilot_service.py index d2a5365..18bc517 100644 --- a/app/services/ai_copilot_service.py +++ b/app/services/ai_copilot_service.py @@ -1,8 +1,22 @@ -"""AI Copilot service — NL query processing, action execution, RBAC, audit logging.""" +"""AI Copilot service — NL query processing, action execution, RBAC, audit logging. + +.. deprecated:: Phase 2 + This module is a legacy leftover of the pre-kommunikation AI chat system. + It is NOT registered in main.py, has NO frontend consumers, and its test + suite is skipped ("ai_copilot routes removed in Phase 2"). + + Shutdown plan (ARCH-059): + 1. ✅ Marked deprecated (this notice) + 2. Remove routes/service/model + ``ai_conversations`` tables in a dedicated + migration once a release confirms zero traffic on /api/v1/ai/copilot/* + 3. Do NOT migrate to kommunikation — the plugin already covers chat via + CommConversation/CommMessage; parity work would be wasted effort. +""" from __future__ import annotations import uuid +import warnings from typing import Any from sqlalchemy import desc, func, select @@ -12,6 +26,7 @@ from app.ai.llm_client import get_llm_client from app.core.audit import log_audit from app.core.permissions import check_permission from app.core.visibility import apply_visibility_filter, check_single_entity_access + try: from app.models.ai_conversation import AIConversation, AIMessage except ImportError: @@ -20,6 +35,13 @@ except ImportError: from app.models.contact import Contact from app.models.workflow import Workflow +warnings.warn( + "app.services.ai_copilot_service is deprecated (ARCH-059) — " + "scheduled for removal; do not build new features on it", + DeprecationWarning, + stacklevel=2, +) + def _safe_iso(dt) -> str | None: if dt is None: diff --git a/docs/test-bugs.md b/docs/test-bugs.md index 804c948..70f9928 100644 --- a/docs/test-bugs.md +++ b/docs/test-bugs.md @@ -953,7 +953,7 @@ Playwright E2E: 10 passed, 24 failed (BUG-011/012/013 — Mock-Daten und data-te - **Datei:** app/core/service_container.py:36-37 - **Problem:** Registriert nur cache und event_bus. comm_websocket und andere Services werden woanders registriert. - **Schweregrad:** Low -- **Status:** ⏳ Nicht gefixt +- **Status:** ✅ Triage 2026-08-24 (Block D/D6): Verifiziertes No-Op — bewusstes Design. Plugin-Services (comm_miniapps, comm_websocket, ai_ui_control_ws) registrieren sich selbst bei Plugin-on_activate (Lifecycle-Symmetrie aus Block A); initialize() stellt nur die Core-Basis bereit (cache, event_bus). Kein unvollständiger Code — Finding war ein Design-Missverständnis. ### ARCH-024: App.tsx hardcoded deutsche Strings ohne i18n - **Datei:** frontend/src/App.tsx:49,61,79 @@ -1169,7 +1169,7 @@ Playwright E2E: 10 passed, 24 failed (BUG-011/012/013 — Mock-Daten und data-te - **Datei:** app/services/ai_copilot_service.py:18-21 - **Problem:** Nutzt `AIConversation`/`AIMessage` aus `app.models.ai_conversation` mit try/except ImportError fallback. Das ist das Legacy AI Chat System das nach kommunikation migriert werden sollte (ARCH-018 pattern). AI Copilot sollte die kommunikation Plugin Conversations nutzen. - **Schweregrad:** Medium -- **Status:** ⏳ Nicht gefixt +- **Status:** ✅ Triage+Deprecation 2026-08-24 (Block D/D6): Beweise — Backend-only (0 Frontend-Referenzen in api/store), Test geskippt ('ai_copilot routes removed in Phase 2'), keine Router-Inklusion in main.py. Migration nach kommunikation wäre Verschwendung (Plugin deckt Chat bereits ab). Modul als deprecated markiert mit Abschaltplan im Service-Docstring; DeprecationWarning bei Import; Entfernung (routes/service/model + ai_conversations-Tabellen) als eigene Migration nach Traffic-Bestätigung. ### ARCH-060: backup_service.py — datetime.utcnow() naive datetime - **Datei:** app/services/backup_service.py:create_backup