2 Commits

Author SHA1 Message Date
Dom
78ee962918 feat(matching): match_current_state_from_state consomme enrichi (Lot E)
Nouvelle méthode match_current_state_from_state(screen_state, workflow_id)
qui utilise directement le ScreenState enrichi (window_title, detected_text,
ui_elements) fourni par ExecutionLoop au lieu de reconstruire un stub
ScreenState("Unknown", ui_elements=[], ...).

Préfère HierarchicalMatcher si workflow chargeable, fallback FAISS sinon.

L'ancienne API match_current_state(screenshot_path, workflow_id) est
convertie en wrapper : appelle ScreenAnalyzer.analyze() puis délègue.
Rétrocompat préservée.

ExecutionLoop._execute_step utilise la nouvelle méthode -> plus de double
analyze() dans le chemin d'exécution (économie latence).

Premier vrai matching context-aware. 11 nouveaux tests + 2 tests
integration loop. 172 tests non-régression verts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 09:07:04 +02:00
Dom
d6e2530f2a feat(execution): Implement complete COACHING mode in ExecutionLoop
- Add CoachingDecision enum (ACCEPT, REJECT, CORRECT, EXECUTE_MANUAL, SKIP)
- Add CoachingResponse dataclass for user decisions
- Add WAITING_COACHING state to ExecutionState
- Implement _request_coaching_decision() with callback or polling support
- Implement submit_coaching_decision() for external API/UI submission
- Implement _apply_coaching_correction() for applying user corrections
- Implement _record_coaching_feedback() integrating with:
  - TrainingDataCollector for session recording
  - FeedbackProcessor for statistics
  - CorrectionPackIntegration for automatic correction capture
- Add get_coaching_stats() for session statistics
- Add 17 unit tests for COACHING functionality

COACHING mode now:
1. Suggests actions to user
2. Waits for user decision (accept/reject/correct/manual/skip)
3. Applies corrections if provided
4. Records all feedback for learning
5. Propagates corrections to Correction Packs automatically

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 19:14:47 +01:00