Commit Graph

4 Commits

Author SHA1 Message Date
Dom
efb184fdb9 feat(corrections): Add automatic COACHING integration for Correction Packs
- Add CorrectionPackIntegration class to bridge learning components
- Modify TrainingDataCollector to auto-propagate corrections to packs
- Modify FeedbackProcessor to capture corrections on INCORRECT/PARTIAL feedback
- Add convenience functions: get_correction_pack_integration(), capture_coaching_correction()
- Add 19 integration tests (all passing)

Corrections made during COACHING mode are now automatically captured
into a dedicated "auto_captured_corrections" pack for cross-workflow reuse.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 19:06:09 +01:00
Dom
d8756883c5 feat(corrections): Add Correction Packs system for cross-workflow learning
Implement a complete system for capitalizing user corrections across multiple
workflows and sessions. This enables automatic application of learned fixes
when similar failures occur in different contexts.

New components:
- core/corrections/models.py: CorrectionKey, Correction, CorrectionPack models
- core/corrections/correction_repository.py: JSON storage with atomic writes
- core/corrections/aggregator.py: Aggregation by hash and quality filtering
- core/corrections/correction_pack_service.py: CRUD, export/import, versioning
- backend/api/correction_packs.py: REST API with 15 endpoints

Features:
- MD5-based key hashing for correction deduplication
- Export/import in JSON and YAML formats
- Version history with rollback support
- Cross-workflow pattern detection
- Integration with SelfHealingEngine for automatic application
- 29 unit tests (all passing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 18:48:35 +01:00
Dom
152431803e fix(agent_chat): Corriger intégration exécution réelle
- Importer les vraies classes Action, TargetSpec, WorkflowEdge, ActionType
- Convertir le type d'action en ActionType Enum au lieu de string
- Créer un ScreenState complet avec tous les niveaux (raw, perception, context)
- Corriger _serialize_state dans error_handler.py pour accès compatibles
- Ajouter import os pour manipulation des fichiers
- Sauvegarder les screenshots dans data/temp/

L'exécution réelle fonctionne maintenant - les erreurs "Target not found"
sont attendues car il faut une vraie interface utilisateur à l'écran.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:43:30 +01:00
Dom
e7657ee1e5 Fix: Embeddings CLIP + Nettoyage post-apprentissage
Ce commit corrige deux problèmes critiques dans le pipeline d'apprentissage:

**Fix A - Embeddings CLIP fonctionnels**
- Problème: Chemins relatifs (shots/shot_0001.png) causaient des erreurs
- Solution: Utilisation de chemins absolus dans processing_pipeline.py et graph_builder.py
- Résultat: Embeddings générés avec succès, patterns détectés par clustering DBSCAN

Modifications:
- server/processing_pipeline.py:279 - Chemin absolu pour ScreenState.raw.screenshot_path
- core/graph/graph_builder.py:310 - Chemin absolu pour GraphBuilder._create_screen_states()

**Fix B - Nettoyage post-apprentissage**
- Problème: Screenshots jamais nettoyés ou nettoyés trop tôt (avant apprentissage)
- Solution: Activation du nettoyage APRÈS création des screen_states
- Résultat: Gain d'espace ~99% (screenshots supprimés, screen_states conservés)

Modifications:
- server/processing_pipeline.py:165 - Nettoyage conditionnel si screen_states créés

Impact:
-  CLIP ViT-B-32 chargé et fonctionnel (512D embeddings)
-  3 patterns détectés sur session test (40 screenshots)
-  Nettoyage automatique: uploads/*.enc, uploads/*.zip, sessions/sess_*/ supprimés
-  Données conservées: screen_states/, embeddings/, workflows/
-  Gain d'espace: 98.3% (6 MB → 100 KB par session)

Testé avec: sess_20260107T220743_6be50905 (40 events, 40 screenshots)
Status:  POC/MVP prêt pour démo investisseurs

🤖 Généré avec [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:24:19 +01:00