# Requirements - Mode Assisté avec Suggestions

## Introduction

Ce document spécifie les exigences pour le Mode Assisté de GeniusIA v2. Le système doit détecter quand l'utilisateur commence un workflow connu et proposer de le compléter automatiquement.

## Glossary

- **Mode Assisté** : Mode où le système suggère des actions mais attend validation
- **Suggestion** : Proposition d'action basée sur un workflow détecté
- **Workflow Match** : Correspondance entre les actions courantes et un workflow connu
- **Confidence Score** : Score de confiance (0-1) pour une suggestion
- **Timeout** : Durée avant qu'une suggestion expire

## Requirements

### Requirement 1

**User Story:** As a user, I want the system to detect when I start a known workflow, so that it can suggest completing it automatically.

#### Acceptance Criteria

1. WHEN the user performs actions in Assist mode THEN the system SHALL compare them with known workflows
2. WHEN the current actions match the beginning of a workflow THEN the system SHALL calculate a confidence score
3. WHEN the confidence score exceeds 80% THEN the system SHALL create a suggestion
4. WHEN a suggestion is created THEN the system SHALL display it to the user within 1 second
5. WHEN multiple workflows match THEN the system SHALL suggest the one with highest confidence

### Requirement 2

**User Story:** As a user, I want to accept or reject suggestions easily, so that I can control the automation.

#### Acceptance Criteria

1. WHEN a suggestion is displayed THEN the system SHALL show the workflow name and remaining steps
2. WHEN the user presses Enter THEN the system SHALL accept the suggestion and execute remaining steps
3. WHEN the user presses Escape THEN the system SHALL reject the suggestion and continue manual mode
4. WHEN the user ignores a suggestion for 10 seconds THEN the system SHALL automatically dismiss it
5. WHEN a suggestion is accepted THEN the system SHALL execute steps with visual feedback

### Requirement 3

**User Story:** As a user, I want suggestions to be accurate, so that I don't get interrupted with irrelevant proposals.

#### Acceptance Criteria

1. WHEN calculating workflow match THEN the system SHALL compare action types and positions
2. WHEN comparing positions THEN the system SHALL allow 50px tolerance
3. WHEN a workflow has been rejected 3 times THEN the system SHALL reduce its suggestion priority
4. WHEN a workflow is successfully executed THEN the system SHALL increase its confidence score
5. WHEN the user is in a different window THEN the system SHALL only suggest workflows for that window

### Requirement 4

**User Story:** As a user, I want to see what the system will do, so that I can trust the automation.

#### Acceptance Criteria

1. WHEN displaying a suggestion THEN the system SHALL show the next 3 steps
2. WHEN displaying steps THEN the system SHALL include action type and target description
3. WHEN a step is executed THEN the system SHALL highlight it visually
4. WHEN execution fails THEN the system SHALL stop and notify the user
5. WHEN all steps complete THEN the system SHALL show a success notification
