# Audit Code Mort — Classification A/B/C — 2026-07-02 **Auteur**: Qwen (vérifié par grep/glob/commandes réelles) **Date**: 2026-07-02 **Méthode**: Parallel agent exploration + grep verification + graphify cross-check --- ## Méthodologie - **A (WIRED/ACTIF)** : Code importé et appelé dans le runtime de production - **B (ORPHAN/PROJECTION)** : Code avec lazy import ou projection future, pas appelé actuellement mais structuré pour activation - **C (MORT/CONFIRMÉ)** : Code zero imports, zero callers, zero runtime activation — candidat suppression **Règle**: C-MORT nécessite GO Dom avant suppression. B-ORPHELIN conserve. A-WIRED documenté. --- ## C-MORT Confirmé (8 items, ~843 lignes) | # | Fichier/Zone | Lignes | Preuve C-MORT | Risque suppression | |---|-------------|--------|---------------|-------------------| | C1 | `agent_v0/deploy_windows.py` | ~244 | Comment "OBSOLETE avril 2026" + zero imports | LOW — standalone script | | C2 | `core/config.py`: 7 deprecated config classes | ~160 | Zero prod imports, mirrorent SystemConfig | LOW — mais vérifier .env references | | C3 | `core/detection/owl_detector.py`: 4 methods | ~90 | Zero callers dans prod | LOW — vérifier examples/ | | C4 | `core/detection/ollama_client.py`: 5 old methods | ~150 | Remplacés par classify_element_complete() | LOW — vérifier examples/ | | C5 | `ollama_client.py:check_ollama_available()` standalone | ~15 | 8/9 callers in examples/, 1 in VWB (duplicat D2) | LOW — VWB a sa propre copie | | C6 | `agent_chat/app.py`: 2 Flask 410 endpoints | ~14 | Endpoints déprecated, retour 410 Gone | LOW — API contract check | | C7 | `core/grounding/smart_resize.py` (77 lines) | 77 | Zero prod callers, DETTE-007 triple impl | LOW — 2 autres impls existent | | C8 | PP-OCRv5 (paddleocr+paddlepaddle venv) | ~deps | 0 .py imports across entire project | LOW — venv deps uninstall | **Total C-MORT**: ~843 lignes code + venv deps --- ## B-ORPHELIN (5 items, ~537 lignes) | # | Fichier/Zone | Lignes | Preuve B | Action | |---|-------------|--------|----------|--------| | B1 | VWB ui_detection_service OmniParser path | ~70 | HARD-DISABILÉ `_omniparser_available = False # DÉSACTIVÉ` | Conserver, documenter activation condition | | B2 | `fusion_engine.py:_fuse_concat_projection()` | ~15 | Stub, prévu pour future fusion modes | Conserver, marque PROJECTION | | B3 | `omniparser_adapter.py` | ~429 | BRANCHABLE DORMANT, try/except import | Conserver, documenter activation condition | | B4 | `CorrectionStatus.DEPRECATED` enum value | ~3 | Enum value, pas supprimable sans break | Conserver, marque DEPRECATED | | B5 | `catalog_routes_v2_vlm.py:check_ollama_available()` | ~20 | Duplicat de ollama_client.py (D2) | DÉCISION Dom : unifier ou garder 2 impls | --- ## Duplicats Identifiés (4) | # | Item | Impl 1 | Impl 2 | Statut | |---|------|--------|--------|--------| | D1 | smart_resize | smart_resize.py (C7) | ui_detection_service.py resize | C-MORT vs WIRED | | D2 | check_ollama_available | ollama_client.py (C5) | catalog_routes_v2_vlm.py (B5) | C-MORT vs B-ORPHELIN | | D3 | ground_element | seeclick_adapter.py (B→provenance?) | ollama_client.py old method | B vs C4 | | D4 | 7 deprecated config classes | core/config.py (C2) | SystemConfig (WIRED) | C-MORT vs A-WIRED | --- ## Classification Updates (C→A upgrades confirmés) | Item | Prior Status | Current Status | Preuve upgrade | |------|-------------|---------------|---------------| | autonomous_planner.py | C | **A** | Migrated to agent_chat/, wired by app.py | | seeclick_adapter.py | C | **B** | Lazy re-export, `_seeclick_available` never consulted mais impl ground_element indépendante | | grounding/server.py | C | **A** | HTTP service port 8200, standalone Flask | | get_grounding_profile() | C | **A** | Wired via ollama_client.py:303-304 lazy import | --- ## OmniParser — Classification 7 Zones | # | Zone | Statut | Activation | Fallback | |---|------|---------|-----------|----------| | 1 | SoM engine (som_engine.py) | **A-WIRED** | YOLO weights direct | docTR OCR | | 2 | resolve_engine (_get_omniparser) | **B-DORMANT** | Lazy Optional[bool] | None → skipped | | 3 | phase25_analyzer (_OmniParserSafeWrapper) | **B-DORMANT** | Lazy import + healthcheck | docTR-only | | 4 | api_stream healthcheck | **A-WIRED** | Always 200 omniparser_available:bool | degraded:true | | 5 | omniparser_adapter.py | **B-DORMANT** | Import phase25 & resolve | empty list | | 6 | VWB ui_detection_service.py | **B-HARD-DISABILÉ** | `_omniparser_available = False # DÉSACTIVÉ` | ui-detr-1 only | | 7 | VWB catalog_routes_v2_vlm.py | **B-DORMANT** | try/except, flips True si installé | VLM fallback | --- ## QG-Gated Lots (proposé, nécessite GO Dom) ### Lot 1 — C-MORT Low Risk (suppression directe après GO Dom) - C1 deploy_windows.py - C7 smart_resize.py - C6 agent_chat 410 endpoints - C8 PP-OCRv5 venv deps uninstall ### Lot 2 — C-MORT Medium Risk (vérification examples/ avant suppression) - C2 7 deprecated config classes (vérifier .env) - C3 owl_detector 4 methods (vérifier examples/) - C4 ollama_client 5 old methods (vérifier examples/) - C5 check_ollama_available standalone (vérifier VWB duplicat) ### Lot 3 — Duplicats Unification (décision Dom) - D1 smart_resize: unifier ou garder 2 impls - D2 check_ollama_available: unifier VWB vs core - D3 ground_element: unifier seeclick vs ollama - D4 config classes: supprimer deprecated vs garder compat --- **Prochaine étape**: Dom review → GO/NOGO par lot → exécution séquentielle avec tests verification après chaque lot.