4.2 KiB
Implementation Plan - Workflow Detection Fix
-
1. Fix VisionAnalysis attribute bug
- Fix the
self.llm_managertoself.llmattribute references - Add error handling around LLM calls
- Ensure action signatures include all required fields
- Requirements: 2.1, 2.2, 2.3
- Fix the
-
* 1.1 Write unit test for VisionAnalysis attribute fix
- Verify no AttributeError is raised when LLM is provided
- Test with and without LLM manager
- Requirements: 2.1
-
* 1.2 Write property test for VisionAnalysis error handling
- Property 6: VisionAnalysis error resilience
- Validates: Requirements 2.2
-
* 1.3 Write property test for action signature completeness
- Property 7: Action signature completeness
- Validates: Requirements 2.3
-
2. Integrate SessionManager into Orchestrator
- Import SessionManager in orchestrator.py
- Initialize SessionManager in Orchestrator.init
- Add action forwarding in the cognitive loop
- Connect session completion callback
- Requirements: 1.1, 1.2
-
* 2.1 Write property test for action forwarding
- Property 1: Action forwarding to SessionManager
- Validates: Requirements 1.1
-
* 2.2 Write property test for session grouping
- Property 2: Session grouping by time and context
- Validates: Requirements 1.2
-
3. Integrate WorkflowDetector into Orchestrator
- Import WorkflowDetector in orchestrator.py
- Initialize WorkflowDetector in Orchestrator.init
- Connect SessionManager to WorkflowDetector
- Implement _on_workflow_detected callback
- Requirements: 1.3, 1.4
-
* 3.1 Write property test for session forwarding to WorkflowDetector
- Property 3: Completed sessions trigger workflow analysis
- Validates: Requirements 1.3
-
* 3.2 Write property test for workflow notifications
- Property 4: Workflow detection triggers notifications
- Validates: Requirements 1.4
-
4. Connect WorkflowDetector to SuggestionManager
- Implement workflow notification in _on_workflow_detected
- Ensure SuggestionManager receives workflow data
- Add logging for workflow detection events
- Requirements: 1.5, 4.2
-
* 4.1 Write property test for suggestion generation
- Property 5: Workflow notifications generate suggestions
- Validates: Requirements 1.5
-
* 4.2 Write property test for workflow detection logging
- Property 11: Workflow detection logging
- Validates: Requirements 4.2
-
5. Implement workflow persistence
- Create workflow save method in WorkflowDetector
- Save workflows to data/user_profiles/workflows/
- Implement workflow loading on startup
- Add confidence score update mechanism
- Requirements: 3.1, 3.2, 3.3
-
* 5.1 Write property test for workflow persistence
- Property 8: Workflow persistence
- Validates: Requirements 3.1
-
* 5.2 Write unit test for workflow loading
- Create test workflow files
- Verify they are loaded on startup
- Requirements: 3.2
-
* 5.3 Write property test for confidence score updates
- Property 9: Confidence score updates
- Validates: Requirements 3.3
-
6. Add comprehensive logging
- Add session creation logging in SessionManager
- Add workflow detection logging in WorkflowDetector
- Add error logging with context
- Requirements: 4.1, 4.3
-
* 6.1 Write property test for session logging
- Property 10: Session logging completeness
- Validates: Requirements 4.1
-
* 6.2 Write property test for error logging
- Property 12: Error logging with context
- Validates: Requirements 4.3
-
7. Checkpoint - Ensure all tests pass
- Ensure all tests pass, ask the user if questions arise.
- Status: ✅ Intégration complète effectuée
- EventCapture passe maintenant les actions au SessionManager
- SessionManager segmente les actions en sessions
- WorkflowDetector analyse les sessions et détecte les patterns
- SuggestionManager reçoit les notifications de workflows
- Orchestrator coordonne tous les composants
-
8. End-to-end integration test
- Create test script that simulates repeated actions
- Verify sessions are created
- Verify workflows are detected
- Verify suggestions are generated
- Requirements: 1.1, 1.2, 1.3, 1.4, 1.5