# 📊 État Actuel - Workflows **Date** : 19 Novembre 2024 **Statut** : 🟱 PrĂȘt pour test end-to-end ## ✅ Ce qui fonctionne ### Architecture 100% Vision ``` APPRENTISSAGE (Mode Shadow) User action → Screenshot + Embedding → Signature visuelle REJEU (Mode AssistĂ©) Signature → Recherche visuelle → Trouve Ă©lĂ©ment → ExĂ©cute ``` **Pas de coordonnĂ©es fixes !** Tout est basĂ© sur la vision. ### Composants testĂ©s 1. **SessionManager** ✅ - Segmente les actions en sessions - Timeout de 5 minutes - DĂ©tecte les changements de fenĂȘtre - Tests: 3/3 rĂ©ussis 2. **WorkflowDetector** ✅ - DĂ©tecte les workflows rĂ©pĂ©tĂ©s (min 3x) - Calcule la similaritĂ© (Levenshtein) - GĂ©nĂšre des noms automatiquement - Confiance: 80-100% - Tests: 3/3 rĂ©ussis 3. **SuggestionManager** ✅ - IntĂ©gration workflows - SuggĂšre la prochaine Ă©tape - Confiance: 100% - Tests: 2/3 rĂ©ussis 4. **EventCapture** ✅ - Capture les Ă©vĂ©nements - Callbacks fonctionnels - IntĂ©gration complĂšte ## 🎯 Exemple de workflow dĂ©tectĂ© ```json { "workflow_id": "workflow_20251118_142300", "name": "Click → Type → Click", "steps": [ { "step_id": 0, "action_type": "click", "target_description": "Ouvrir lanceur", "window": "Desktop" }, { "step_id": 1, "action_type": "type", "target_description": "Chercher OnlyOffice", "window": "Desktop" }, { "step_id": 2, "action_type": "click", "target_description": "Lancer OnlyOffice", "window": "Desktop" } ], "repetitions": 8, "confidence": 1.0 } ``` ## 💡 Comment ça marche ### Phase 1 : Apprentissage (3 rĂ©pĂ©titions) ``` RĂ©pĂ©tition 1 → Session 1 créée RĂ©pĂ©tition 2 → Session 2 créée RĂ©pĂ©tition 3 → Session 3 créée ↓ Analyse des sessions ↓ Workflow dĂ©tectĂ© ! 🎉 ``` ### Phase 2 : Suggestion (4Ăšme fois) ``` Action 1 (click) → AjoutĂ©e Ă  session courante Action 2 (type) → AjoutĂ©e Ă  session courante ↓ Comparaison avec workflows connus ↓ Match trouvĂ© (80%+) ↓ Suggestion : "Prochaine Ă©tape" 💡 ``` ### Phase 3 : Rejeu (100% vision) ``` Signature visuelle → Recherche dans Ă©cran actuel ↓ ÉlĂ©ment trouvĂ© (x, y) ↓ Action exĂ©cutĂ©e ✅ ``` ## đŸ§Ș Tests disponibles ### Tests unitaires ```bash # Test SessionManager + WorkflowDetector python test_workflows_simple.py # RĂ©sultat: 3/3 ✅ # Test intĂ©gration complĂšte python test_mode_assiste_workflows.py # RĂ©sultat: 2/3 ✅ ``` ### Test manuel ```bash # Lancer le test guidĂ© ./lancer_test.sh # Ou lancer directement cd geniusia2 ./run.sh ``` ## 📊 MĂ©triques ### DĂ©tection - **RĂ©pĂ©titions minimum** : 3 - **Seuil de similaritĂ©** : 75% - **Timeout session** : 5 minutes - **Confiance workflow** : 80-100% ### Suggestion - **Seuil de match** : 80% - **Confiance** : workflow.confidence × match_score - **Timeout suggestion** : 10 secondes ## 🚀 Prochaine Ă©tape **Test end-to-end avec vraie application !** Utilise `./lancer_test.sh` pour un test guidĂ©. ## 🐛 Debug ### Voir les sessions ```bash ls -la geniusia2/data/user_profiles/sessions/ cat geniusia2/data/user_profiles/sessions/session_*.json ``` ### Voir les workflows ```bash ls -la geniusia2/data/user_profiles/workflows/ cat geniusia2/data/user_profiles/workflows/workflow_*.json ``` ### Voir les logs ```bash tail -100 geniusia2/data/logs/actions.log | grep -E "session|workflow|suggestion" ``` ## 💡 Conseils - **Sois rĂ©gulier** : RĂ©pĂšte exactement la mĂȘme sĂ©quence - **Pas trop vite** : Laisse 1-2 secondes entre les actions - **MĂȘme fenĂȘtre** : Reste dans la mĂȘme application - **Patience** : L'analyse prend quelques secondes ## 🎯 Objectif VĂ©rifier que le systĂšme : 1. ✅ DĂ©tecte les workflows automatiquement 2. ✅ SuggĂšre la prochaine Ă©tape 3. ✅ Fonctionne en 100% vision 4. 🚧 Affiche les suggestions (overlay Ă  tester) --- **PrĂȘt pour le test !** 🚀 **Commande** : `./lancer_test.sh`