fix: Auto-detect modules path (./modules/ or ./build/modules/)
- main.cpp now checks for modules in ./modules/ first, falls back to ./build/modules/ if not found or empty - Allows running from project root: ./build/aissia - Update SUCCESSION.md with current state and FileSystem tools docs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
37b62b55e8
commit
f06c13c195
@ -2,52 +2,45 @@
|
|||||||
|
|
||||||
## Contexte
|
## Contexte
|
||||||
|
|
||||||
AISSIA = Assistant vocal agentique basé sur GroveEngine (C++17 hot-reload). Architecture "Claude Code en vocal" avec tools internes + MCP.
|
AISSIA = Assistant vocal agentique basé sur GroveEngine (C++17 hot-reload). Architecture "Claude Code en vocal" avec tools internes + FileSystem + MCP.
|
||||||
|
|
||||||
**Dernier commit** : `92fb0b7`
|
**Dernier commit** : `37b62b5`
|
||||||
|
|
||||||
## Ce qui a été fait (Session actuelle)
|
## État Actuel
|
||||||
|
|
||||||
### Infrastructure de Tests d'Intégration
|
### Ce qui fonctionne
|
||||||
|
|
||||||
Créé **110 tests d'intégration** avec Catch2 :
|
✅ **Build complet** - `cmake -B build && cmake --build build -j4`
|
||||||
|
✅ **6 modules hot-reload** - Scheduler, Notification, Monitoring, AI, Voice, Storage
|
||||||
|
✅ **4 services** - LLMService, StorageService, PlatformService, VoiceService
|
||||||
|
✅ **17 tools pour l'agent** :
|
||||||
|
- 11 tools internes (via IIO pub/sub)
|
||||||
|
- 6 FileSystem tools (read/write/edit/list/glob/grep)
|
||||||
|
- MCP tools (désactivés par défaut)
|
||||||
|
✅ **Tests** - 67/75 tests modules+types passent
|
||||||
|
|
||||||
```
|
### Lancement
|
||||||
tests/
|
|
||||||
├── CMakeLists.txt # Config Catch2, targets test_all/test_modules/test_mcp
|
```bash
|
||||||
├── main.cpp
|
# Build
|
||||||
├── mocks/
|
cmake -B build && cmake --build build -j4
|
||||||
│ ├── MockIO.hpp/cpp # Mock IIO pub/sub (fonctionnel)
|
|
||||||
│ └── MockTransport.hpp # Mock IMCPTransport (fonctionnel)
|
# Run (depuis racine ou build/)
|
||||||
├── utils/
|
./build/aissia
|
||||||
│ ├── TestHelpers.hpp # Macros REQUIRE_PUBLISHED, tags
|
|
||||||
│ └── TimeSimulator.hpp # Simulation gameTime pour modules
|
# Tests
|
||||||
├── fixtures/
|
cmake -B build -DBUILD_TESTING=ON
|
||||||
│ ├── echo_server.py # Echo JSON-RPC pour tests transport
|
./build/tests/aissia_tests "[scheduler],[notification]" # Modules
|
||||||
│ ├── mock_mcp_server.py # Serveur MCP complet (initialize, tools/list, tools/call)
|
./build/tests/aissia_tests "[types]" # MCP types
|
||||||
│ └── mock_mcp.json # Config test
|
|
||||||
├── modules/ # 60 TI (10 par module)
|
|
||||||
│ ├── SchedulerModuleTests.cpp
|
|
||||||
│ ├── NotificationModuleTests.cpp
|
|
||||||
│ ├── MonitoringModuleTests.cpp
|
|
||||||
│ ├── AIModuleTests.cpp
|
|
||||||
│ ├── VoiceModuleTests.cpp
|
|
||||||
│ └── StorageModuleTests.cpp
|
|
||||||
└── mcp/ # 50 TI
|
|
||||||
├── MCPTypesTests.cpp # 15 TI - serialisation JSON
|
|
||||||
├── StdioTransportTests.cpp # 20 TI - process spawn, IPC, timeout
|
|
||||||
└── MCPClientTests.cpp # 15 TI - multi-server, routing
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Plan de Tests Détaillé
|
### Variables d'Environnement
|
||||||
|
|
||||||
Créé `PLAN_TESTS_INTEGRATION.md` avec :
|
```bash
|
||||||
- Tableau de tous les 110 TI avec descriptions
|
export ANTHROPIC_API_KEY="sk-ant-..." # Requis pour Claude API
|
||||||
- Exemples de code pour chaque catégorie
|
```
|
||||||
- Ordre d'implémentation en 5 sprints
|
|
||||||
- Métriques de succès
|
|
||||||
|
|
||||||
## Architecture Actuelle
|
## Architecture
|
||||||
|
|
||||||
```
|
```
|
||||||
┌─────────────────────────────────────────────────────────────┐
|
┌─────────────────────────────────────────────────────────────┐
|
||||||
@ -55,8 +48,9 @@ Créé `PLAN_TESTS_INTEGRATION.md` avec :
|
|||||||
│ (Agentic Loop) │
|
│ (Agentic Loop) │
|
||||||
├─────────────────────────────────────────────────────────────┤
|
├─────────────────────────────────────────────────────────────┤
|
||||||
│ ToolRegistry │
|
│ ToolRegistry │
|
||||||
│ ├── InternalTools (11 tools) ─────► IIO pub/sub │
|
│ ├── InternalTools (11) ─────► IIO pub/sub │
|
||||||
│ └── MCPClient (tools externes) ─────► stdio JSON-RPC │
|
│ ├── FileSystemTools (6) ────► Direct C++ (read/write/edit) │
|
||||||
|
│ └── MCPClient (optionnel) ──► stdio JSON-RPC │
|
||||||
└─────────────────────────────────────────────────────────────┘
|
└─────────────────────────────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
┌──────────────┬─────┴──────┬──────────────┐
|
┌──────────────┬─────┴──────┬──────────────┐
|
||||||
@ -64,111 +58,122 @@ Créé `PLAN_TESTS_INTEGRATION.md` avec :
|
|||||||
Module Module Module Module
|
Module Module Module Module
|
||||||
```
|
```
|
||||||
|
|
||||||
### Modules (Hot-Reloadable)
|
### Tools Disponibles
|
||||||
|
|
||||||
| Module | Fonctionnalité | Topics |
|
| Catégorie | Tools | Communication |
|
||||||
|--------|----------------|--------|
|
|-----------|-------|---------------|
|
||||||
| SchedulerModule | Tâches, hyperfocus, breaks | `scheduler:*` |
|
| Scheduler | get_current_task, list_tasks, start_task, complete_task, start_break | IIO |
|
||||||
| NotificationModule | Queue notifications, priorités | - |
|
| Monitoring | get_focus_stats, get_current_app | IIO |
|
||||||
| MonitoringModule | Classification apps, stats | `monitoring:*` |
|
| Storage | save_note, query_notes, get_session_history | IIO |
|
||||||
| AIModule | Logique LLM, suggestions | `ai:*`, `llm:*` |
|
| Voice | speak | IIO |
|
||||||
| VoiceModule | TTS/STT coordination | `voice:*` |
|
| FileSystem | read_file, write_file, edit_file, list_directory, glob_files, grep_files | Direct C++ |
|
||||||
| StorageModule | Notes, persistence | `storage:*` |
|
|
||||||
|
|
||||||
### Services (Non Hot-Reloadable)
|
### FileSystem Tools (Nouveau)
|
||||||
|
|
||||||
| Service | Rôle |
|
Implémentés dans `src/shared/tools/FileSystemTools.*` :
|
||||||
|---------|------|
|
|
||||||
| LLMService | HTTP Claude/OpenAI, agentic loop, tools |
|
```cpp
|
||||||
| StorageService | SQLite, prepared statements |
|
// Lecture avec numéros de ligne
|
||||||
| PlatformService | Window tracking (Win32/X11) |
|
FileSystemTools::execute("read_file", {{"path", "/path/to/file"}, {"limit", 10}});
|
||||||
| VoiceService | TTS (SAPI/espeak), STT (Whisper) |
|
|
||||||
|
// Édition style Claude Code
|
||||||
|
FileSystemTools::execute("edit_file", {
|
||||||
|
{"path", "/path/to/file"},
|
||||||
|
{"old_string", "foo"},
|
||||||
|
{"new_string", "bar"}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Recherche
|
||||||
|
FileSystemTools::execute("glob_files", {{"pattern", "**/*.cpp"}});
|
||||||
|
FileSystemTools::execute("grep_files", {{"pattern", "TODO"}, {"path", "./src"}});
|
||||||
|
```
|
||||||
|
|
||||||
|
**Sécurité** :
|
||||||
|
- Chemins autorisés configurables
|
||||||
|
- Patterns bloqués : `*.env`, `*.key`, `*credentials*`
|
||||||
|
- Limites : 1MB lecture, 10MB écriture
|
||||||
|
|
||||||
|
## Fichiers Clés
|
||||||
|
|
||||||
|
### Nouveaux (Session actuelle)
|
||||||
|
```
|
||||||
|
src/shared/tools/FileSystemTools.hpp
|
||||||
|
src/shared/tools/FileSystemTools.cpp
|
||||||
|
PLAN_FILESYSTEM_TOOLS.md
|
||||||
|
```
|
||||||
|
|
||||||
|
### Services
|
||||||
|
```
|
||||||
|
src/services/LLMService.* # Agentic loop, tools registry
|
||||||
|
src/services/StorageService.* # SQLite persistence
|
||||||
|
src/services/PlatformService.* # Window tracking
|
||||||
|
src/services/VoiceService.* # TTS/STT
|
||||||
|
```
|
||||||
|
|
||||||
|
### Modules (Hot-Reload)
|
||||||
|
```
|
||||||
|
src/modules/SchedulerModule.*
|
||||||
|
src/modules/NotificationModule.*
|
||||||
|
src/modules/MonitoringModule.*
|
||||||
|
src/modules/AIModule.*
|
||||||
|
src/modules/VoiceModule.*
|
||||||
|
src/modules/StorageModule.*
|
||||||
|
```
|
||||||
|
|
||||||
### MCP
|
### MCP
|
||||||
|
```
|
||||||
|
src/shared/mcp/MCPTypes.hpp
|
||||||
|
src/shared/mcp/MCPClient.*
|
||||||
|
src/shared/mcp/StdioTransport.*
|
||||||
|
config/mcp.json
|
||||||
|
```
|
||||||
|
|
||||||
| Fichier | Description |
|
## Tests
|
||||||
|---------|-------------|
|
|
||||||
| `MCPTypes.hpp` | Structs (Tool, Resource, JsonRpc*) |
|
|
||||||
| `MCPTransport.hpp` | Interface abstraite |
|
|
||||||
| `StdioTransport.*` | Fork/exec + JSON-RPC stdio |
|
|
||||||
| `MCPClient.*` | Multi-serveur, routing tools |
|
|
||||||
|
|
||||||
## Commandes
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build standard
|
|
||||||
cmake -B build && cmake --build build -j4
|
|
||||||
|
|
||||||
# Build avec tests
|
# Build avec tests
|
||||||
cmake -B build -DBUILD_TESTING=ON && cmake --build build -j4
|
cmake -B build -DBUILD_TESTING=ON && cmake --build build -j4
|
||||||
|
|
||||||
# Exécuter tous les tests
|
# Par catégorie
|
||||||
cmake --build build --target test_all
|
./build/tests/aissia_tests "[scheduler]" # 10 tests
|
||||||
|
./build/tests/aissia_tests "[notification]" # 10 tests
|
||||||
|
./build/tests/aissia_tests "[types]" # 15 tests MCP
|
||||||
|
|
||||||
# Tests par catégorie
|
# Tous les modules
|
||||||
./build/aissia_tests "[scheduler]"
|
./build/tests/aissia_tests "[scheduler],[notification],[monitoring],[ai],[voice],[storage]"
|
||||||
./build/aissia_tests "[mcp]"
|
|
||||||
./build/aissia_tests "[mcp][types]"
|
|
||||||
./build/aissia_tests "[mcp][transport]"
|
|
||||||
|
|
||||||
# Run AISSIA
|
|
||||||
./build/aissia
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## État des Tests
|
**Résultats actuels** :
|
||||||
|
- Modules : 52/60 (87%)
|
||||||
Les tests sont des **squelettes fonctionnels** :
|
- MCP Types : 15/15 (100%)
|
||||||
- Fixtures et mocks implémentés
|
- MCP Transport/Client : Nécessite fix serveurs Python
|
||||||
- TEST_CASE avec assertions réelles
|
|
||||||
- Certaines vérifications d'état marquées `// TODO` (nécessitent getState() côté module)
|
|
||||||
|
|
||||||
**Prêt à compiler** mais nécessite :
|
|
||||||
1. Vérifier que GroveEngine expose `grove::Message` correctement
|
|
||||||
2. Les modules doivent exposer leur état via `getState()` pour les assertions
|
|
||||||
|
|
||||||
## Prochaines Étapes
|
## Prochaines Étapes
|
||||||
|
|
||||||
### Priorité Haute
|
### Priorité Haute
|
||||||
1. **Compiler les tests** - `cmake -B build -DBUILD_TESTING=ON`
|
1. **Tester avec API key** - Vérifier la boucle agentique complète
|
||||||
2. **Fixer les erreurs de compilation** - Probablement des includes manquants
|
2. **Activer MCP filesystem** - Pour tests end-to-end avec tools externes
|
||||||
3. **Compléter les `// TODO`** - Assertions sur getState() des modules
|
|
||||||
|
|
||||||
### Priorité Moyenne
|
### Priorité Moyenne
|
||||||
4. **Ajouter CI** - GitHub Actions ou GitLab CI pour run tests
|
3. **Fixer tests MCP Transport** - Les serveurs Python reçoivent EOF
|
||||||
5. **Couverture de code** - gcov/lcov
|
4. **Ajouter plus de tools** - add_task, set_reminder, etc.
|
||||||
6. **Tests end-to-end** - Flux complet inter-modules
|
5. **Streaming responses** - Feedback temps réel pendant génération
|
||||||
|
|
||||||
### Priorité Basse
|
### Priorité Basse
|
||||||
7. **Tests de performance** - Latence IIO, throughput MCP
|
6. **Tests end-to-end** - Flux complet inter-modules
|
||||||
8. **Fuzzing** - MCPTypes parsing, JsonRpc
|
7. **CI/CD** - GitHub Actions
|
||||||
|
8. **Documentation API** - Doxygen
|
||||||
## Fichiers Clés Modifiés
|
|
||||||
|
|
||||||
```
|
|
||||||
CMakeLists.txt # Ajout option BUILD_TESTING + add_subdirectory(tests)
|
|
||||||
PLAN_TESTS_INTEGRATION.md # Plan détaillé des 110 TI (nouveau)
|
|
||||||
tests/ # Toute la structure (nouveau)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Variables d'Environnement
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export ANTHROPIC_API_KEY="sk-ant-..." # Claude API
|
|
||||||
export BRAVE_API_KEY="..." # Si MCP brave-search activé
|
|
||||||
```
|
|
||||||
|
|
||||||
## Notes Techniques
|
## Notes Techniques
|
||||||
|
|
||||||
### MockIO
|
### WSL
|
||||||
- Capture tous les `publish()` dans un vector
|
- Window tracker non disponible (stub utilisé)
|
||||||
- Permet `injectMessage()` pour simuler messages entrants
|
- espeak non installé (TTS stub)
|
||||||
- Helpers : `wasPublished()`, `getLastPublished()`, `countPublished()`
|
- Tout le reste fonctionne
|
||||||
|
|
||||||
### TimeSimulator
|
### Hot-Reload
|
||||||
- Simule `gameTime` pour les modules
|
Les modules sont des `.so` chargés dynamiquement. Pour recompiler un module :
|
||||||
- `advanceMinutes()` pratique pour tests hyperfocus
|
```bash
|
||||||
- `createInput()` génère le JSON attendu par `process()`
|
cmake --build build --target SchedulerModule
|
||||||
|
# Le module sera rechargé au prochain cycle si modifié
|
||||||
### Fixtures Python
|
```
|
||||||
- `echo_server.py` : echo params en result
|
|
||||||
- `mock_mcp_server.py` : implémente initialize, tools/list, tools/call
|
|
||||||
|
|||||||
10
src/main.cpp
10
src/main.cpp
@ -172,8 +172,14 @@ int main(int argc, char* argv[]) {
|
|||||||
std::signal(SIGINT, signalHandler);
|
std::signal(SIGINT, signalHandler);
|
||||||
std::signal(SIGTERM, signalHandler);
|
std::signal(SIGTERM, signalHandler);
|
||||||
|
|
||||||
// Paths
|
// Paths - try ./modules/ first, fallback to ./build/modules/
|
||||||
const std::string modulesDir = "./modules/";
|
std::string modulesDir = "./modules/";
|
||||||
|
if (!fs::exists(modulesDir) || fs::is_empty(modulesDir)) {
|
||||||
|
if (fs::exists("./build/modules/")) {
|
||||||
|
modulesDir = "./build/modules/";
|
||||||
|
spdlog::info("Using modules from: {}", modulesDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
const std::string configDir = "./config/";
|
const std::string configDir = "./config/";
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user