Files
rpa_vision_v3/.kiro/specs/admin-monitoring/tasks.md
Dom a7de6a488b feat: replay E2E fonctionnel — 25/25 actions, 0 retries, SomEngine via serveur
Validé sur PC Windows (DESKTOP-58D5CAC, 2560x1600) :
- 8 clics résolus visuellement (1 anchor_template, 1 som_text_match, 6 som_vlm)
- Score moyen 0.75, temps moyen 1.6s
- Texte tapé correctement (bonjour, test word, date, email)
- 0 retries, 2 actions non vérifiées (OK)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:04:41 +02:00

7.0 KiB

Implementation Plan

  • 1. Set up monitoring module structure

    • Create core/monitoring/ directory with __init__.py
    • Define base interfaces and types
    • Requirements: 3.1, 4.1
  • 2. Implement centralized logging system

    • 2.1 Create LogEntry dataclass and RPALogger class
      • Implement structured log entries with timestamp, level, component, message
      • Add workflow_id and node_id metadata support
      • Implement info, warning, error, debug methods
      • Requirements: 4.1, 4.2
    • * 2.2 Write property test for log entry structure
      • Property 9: Log entry structure completeness
      • Validates: Requirements 4.1
    • * 2.3 Write property test for workflow metadata inclusion
      • Property 10: Workflow log metadata inclusion
      • Validates: Requirements 4.2
    • 2.4 Implement get_logger factory function
      • Create singleton pattern for component loggers
      • Configure file and console handlers
      • Requirements: 4.1
  • 3. Implement Prometheus metrics integration

    • 3.1 Create metrics module with Counter, Histogram, Gauge definitions
      • Define workflow_executions_total counter
      • Define workflow_duration_seconds histogram
      • Define log_entries_total counter
      • Define active_workflows and error_rate gauges
      • Requirements: 3.1, 3.2, 3.3, 3.4
    • * 3.2 Write property test for metrics format validity
      • Property 6: Prometheus metrics format validity
      • Validates: Requirements 3.1
    • 3.3 Integrate metrics with logger
      • Increment log_entries_total on each log write
      • Requirements: 4.4
    • * 3.4 Write property test for log counter synchronization
      • Property 12: Log counter synchronization
      • Validates: Requirements 4.4
  • 4. Checkpoint - Ensure all tests pass

    • Ensure all tests pass, ask the user if questions arise.
  • 5. Implement Chain Manager

    • 5.1 Create WorkflowChain dataclass and ChainManager class
      • Implement chain storage and retrieval
      • Implement list_chains and get_chain methods
      • Requirements: 1.1
    • * 5.2 Write property test for chain listing completeness
      • Property 1: Chain listing completeness
      • Validates: Requirements 1.1
    • 5.3 Implement chain creation with workflow validation
      • Implement create_chain method
      • Implement validate_workflows_exist method
      • Requirements: 1.2
    • * 5.4 Write property test for chain workflow validation
      • Property 2: Chain workflow validation
      • Validates: Requirements 1.2
    • 5.5 Implement chain execution logic
      • Execute workflows in sequence
      • Stop on failure and report failure point
      • Requirements: 1.3, 1.4
    • * 5.6 Write property test for chain execution failure handling
      • Property 3: Chain execution stops on failure
      • Validates: Requirements 1.4
  • 6. Implement Trigger Manager

    • 6.1 Create Trigger dataclass and TriggerManager class
      • Implement trigger storage and retrieval
      • Implement list_triggers and get_trigger methods
      • Requirements: 2.1
    • * 6.2 Write property test for trigger listing completeness
      • Property 4: Trigger listing completeness
      • Validates: Requirements 2.1
    • 6.3 Implement trigger creation with config validation
      • Implement create_trigger method
      • Implement validate_config method for schedule triggers
      • Requirements: 2.2
    • 6.4 Implement trigger enable/disable functionality
      • Implement enable_trigger and disable_trigger methods
      • Persist state changes to storage
      • Requirements: 2.3
    • * 6.5 Write property test for trigger state persistence
      • Property 5: Trigger state persistence
      • Validates: Requirements 2.3
  • 7. Checkpoint - Ensure all tests pass

    • Ensure all tests pass, ask the user if questions arise.
  • 8. Implement Log Exporter

    • 8.1 Create LogExporter class with ZIP generation
      • Implement export_to_zip method
      • Generate execution_logs.json, error_logs.json, metrics.json
      • Requirements: 5.1, 5.2
    • * 8.2 Write property test for ZIP archive validity
      • Property 13: ZIP archive validity
      • Validates: Requirements 5.1
    • * 8.3 Write property test for ZIP archive contents
      • Property 14: ZIP archive contents
      • Validates: Requirements 5.2
    • 8.4 Implement date range filtering for log export
      • Filter logs by start_time and end_time parameters
      • Requirements: 5.4
    • * 8.5 Write property test for date range filtering
      • Property 15: Date range filtering
      • Validates: Requirements 5.4
  • 9. Implement workflow metrics tracking

    • 9.1 Add workflow execution counter increment
      • Increment counter on workflow start/end
      • Include workflow_id and status labels
      • Requirements: 3.2
    • * 9.2 Write property test for counter increment
      • Property 7: Workflow execution counter increment
      • Validates: Requirements 3.2
    • 9.3 Add workflow duration histogram recording
      • Record duration on workflow completion
      • Requirements: 3.3
    • * 9.4 Write property test for histogram recording
      • Property 8: Workflow duration histogram recording
      • Validates: Requirements 3.3
  • 10. Update web dashboard API

    • 10.1 Add chains API endpoints
      • GET /api/chains - list all chains
      • POST /api/chains - create new chain
      • POST /api/chains//execute - execute chain
      • Requirements: 1.1, 1.2, 1.3
    • 10.2 Add triggers API endpoints
      • GET /api/triggers - list all triggers
      • POST /api/triggers - create new trigger
      • POST /api/triggers//toggle - enable/disable trigger
      • Requirements: 2.1, 2.2, 2.3
    • 10.3 Add logs download endpoint
      • GET /api/logs/download - download logs as ZIP
      • Support date range query parameters
      • Requirements: 5.1, 5.3, 5.4
    • 10.4 Add Prometheus metrics endpoint
      • GET /metrics - return Prometheus-formatted metrics
      • Requirements: 3.1
    • * 10.5 Write property test for log filtering via API
      • Property 11: Log filtering correctness
      • Validates: Requirements 4.3
  • 11. Update admin interface HTML

    • 11.1 Add navigation links for new sections
      • Add Chains, Triggers, Metrics links to navbar
      • Requirements: 6.1
    • 11.2 Create chains section with dynamic loading
      • Display chain cards with workflow sequence
      • Add create and execute buttons
      • Requirements: 6.2
    • 11.3 Create triggers section with dynamic loading
      • Display trigger cards with type and status
      • Add enable/disable toggle
      • Requirements: 6.2
    • 11.4 Update logs section with download button
      • Add download ZIP button
      • Add refresh functionality
      • Requirements: 6.3
    • 11.5 Create metrics section with real-time display
      • Show key metrics with auto-refresh
      • Requirements: 6.4
  • 12. Final Checkpoint - Ensure all tests pass

    • Ensure all tests pass, ask the user if questions arise.