- Create 4 infrastructure services (LLM, Storage, Platform, Voice) - Refactor all modules to pure business logic (no HTTP/SQLite/Win32) - Add bundled SQLite amalgamation for MinGW compatibility - Make OpenSSL optional in CMake configuration - Fix topic naming convention (colon format) - Add succession documentation Build status: CMake config needs SQLite C language fix (documented) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
125 lines
3.8 KiB
Markdown
125 lines
3.8 KiB
Markdown
# Document de Succession - Refactoring AISSIA
|
|
|
|
## Contexte
|
|
|
|
Refactoring du code AISSIA pour le rendre conforme aux principes GroveEngine (audit initial : 33% conforme, 2/6 modules).
|
|
|
|
## Ce qui a été fait
|
|
|
|
### 1. Architecture Services (nouveau)
|
|
|
|
Créé 4 services dans `src/services/` qui gèrent l'infrastructure :
|
|
|
|
| Service | Fichiers | Responsabilité |
|
|
|---------|----------|----------------|
|
|
| LLMService | `LLMService.hpp/.cpp` | HTTP vers Claude/OpenAI API |
|
|
| StorageService | `StorageService.hpp/.cpp` | SQLite persistence |
|
|
| PlatformService | `PlatformService.hpp/.cpp` | Win32 window tracking |
|
|
| VoiceService | `VoiceService.hpp/.cpp` | TTS/STT engines |
|
|
|
|
Interface commune : `IService.hpp`
|
|
|
|
### 2. Modules refactorisés (logique pure)
|
|
|
|
| Module | Avant | Après | Changements |
|
|
|--------|-------|-------|-------------|
|
|
| AIModule | 306 lignes, HTTP direct | ~170 lignes | Publie `llm:request`, écoute `llm:response` |
|
|
| StorageModule | 273 lignes, sqlite3 | ~130 lignes | Publie `storage:save_*` |
|
|
| MonitoringModule | 222 lignes, Win32 | ~190 lignes | Écoute `platform:window_*` |
|
|
| VoiceModule | 209 lignes, COM/TTS | ~155 lignes | Publie `voice:speak` |
|
|
| SchedulerModule | - | - | Topics corrigés (`:` au lieu de `/`) |
|
|
| NotificationModule | - | - | Déjà conforme |
|
|
|
|
### 3. main.cpp réécrit
|
|
|
|
- Initialise les 4 services avant les modules
|
|
- `MessageRouter` gère le routage IIO entre services et modules
|
|
- Services process() avant modules dans la boucle principale
|
|
|
|
### 4. CMakeLists.txt
|
|
|
|
- SQLite bundled dans `deps/sqlite/` (amalgamation)
|
|
- OpenSSL rendu optionnel
|
|
- Nouvelles targets : `AissiaServices`, `AissiaLLM`, `AissiaPlatform`, `AissiaAudio`
|
|
|
|
## État du build
|
|
|
|
### Problème actuel
|
|
```
|
|
CMake Error: Cannot determine link language for target "sqlite3"
|
|
```
|
|
|
|
### Fix appliqué (dans CMakeLists.txt)
|
|
```cmake
|
|
enable_language(C) # SQLite is C code
|
|
add_library(sqlite3 STATIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/deps/sqlite/sqlite3.c
|
|
)
|
|
set_target_properties(sqlite3 PROPERTIES LINKER_LANGUAGE C)
|
|
```
|
|
|
|
### Pour terminer le build
|
|
```bash
|
|
cd C:\Users\alexi\Documents\projects\aissia
|
|
rm -rf build # Clean start recommandé
|
|
cmake -G "MinGW Makefiles" -B build
|
|
cmake --build build -j4
|
|
```
|
|
|
|
## Fichiers créés/modifiés
|
|
|
|
### Nouveaux fichiers
|
|
- `src/services/IService.hpp`
|
|
- `src/services/LLMService.hpp` / `.cpp`
|
|
- `src/services/StorageService.hpp` / `.cpp`
|
|
- `src/services/PlatformService.hpp` / `.cpp`
|
|
- `src/services/VoiceService.hpp` / `.cpp`
|
|
- `deps/sqlite/sqlite3.c` (téléchargé)
|
|
- `deps/sqlite/sqlite3.h`
|
|
|
|
### Fichiers modifiés
|
|
- `src/main.cpp` - réécrit complètement
|
|
- `src/modules/AIModule.h` / `.cpp`
|
|
- `src/modules/StorageModule.h` / `.cpp`
|
|
- `src/modules/MonitoringModule.h` / `.cpp`
|
|
- `src/modules/VoiceModule.h` / `.cpp`
|
|
- `src/modules/SchedulerModule.h` / `.cpp`
|
|
- `CMakeLists.txt`
|
|
- `external/GroveEngine/CMakeLists.txt` (OpenSSL optionnel)
|
|
|
|
## Communication Inter-Modules (Topics)
|
|
|
|
Format : `module:event` (utiliser `:` pas `/`)
|
|
|
|
### LLM
|
|
- `llm:request` - Module -> Service
|
|
- `llm:response` - Service -> Module
|
|
- `llm:error` - Service -> Module
|
|
|
|
### Storage
|
|
- `storage:save_session` - Module -> Service
|
|
- `storage:save_app_usage` - Module -> Service
|
|
- `storage:session_saved` - Service -> Module
|
|
- `storage:ready` - Service -> Module
|
|
|
|
### Platform
|
|
- `platform:window_info` - Service -> Module
|
|
- `platform:window_changed` - Service -> Module
|
|
- `platform:idle_detected` - Service -> Module
|
|
|
|
### Voice
|
|
- `voice:speak` - Module -> Service
|
|
- `voice:speaking_started` - Service -> Module
|
|
|
|
### Scheduler (existant)
|
|
- `scheduler:hyperfocus_alert`
|
|
- `scheduler:break_reminder`
|
|
- `scheduler:focus_session_started`
|
|
|
|
## Prochaines étapes
|
|
|
|
1. Terminer le build (fix SQLite C language)
|
|
2. Tester compilation de tous les modules
|
|
3. Vérifier hot-reload fonctionne
|
|
4. Tests d'intégration services <-> modules
|