--- name: plan-deploiement-navigation-2026-07-01 description: Plan déploiement + vérification pour wiring navigate — diff, smoke, rollback. Commit = GO Dom supervisé. v2 corrigée après revue croisée Claude. type: project --- # Plan de déploiement — Wiring navigate (brique navigation serveur) - Date : 2026-07-01 23:50 → **v2 2026-07-02 11:00** (corrections après revue croisée Claude) - Branche : `feat/push-log-dgx` - Commit = **GO Dom supervisé** (serveur DGX clinique live) ## Fichiers modifiés (3 hotspots + 4 modules navigation + 6 fichiers tests) | Fichier | Changement | Lignes | |---------|-----------|--------| | `agent_v0/server_v1/api_stream.py` | +1 import `from core.navigation import _handle_navigate_action` + +1 dispatch `elif type_ == "navigate"` (asyncio.wait_for, timeout=180s) | +10 | | `agent_v0/server_v1/replay_engine.py` | +1 `"navigate"` dans `_ALLOWED_ACTION_TYPES` + +1 `"navigate"` dans `_SERVER_SIDE_ACTION_TYPES` | +2 | | `core/navigation/__init__.py` | Nouveau : handler `_handle_navigate_action` + exports `__all__` | +115 | | `core/navigation/visual_verifier.py` | Nouveau : OCR-ancré verify_before/after, fuzzy match | +408 | | `core/navigation/grounding.py` | Nouveau : OCR-anchor-first + VLM fallback + coords cache | +375 | | `core/navigation/visual_login.py` | Nouveau : DPI urgences login, verify + resolve | +227 | | `core/navigation/action_resolver.py` | Nouveau : coords normalisés, OCR adapters | +205 | **Tests ajoutés (6 fichiers, 131 tests) :** | Fichier | Tests | Rôle | |---------|-------|------| | `tests/unit/test_visual_verifier.py` | 48 | OCR-ancré, fuzzy match, verify_before/after | | `tests/unit/test_grounding.py` | 39 | OCR-anchor, VLM fallback, coords cache | | `tests/unit/test_visual_login.py` | 17 | DPI urgences login, verify + resolve | | `tests/unit/test_action_resolver.py` | 14 | coords normalisés, OCR adapters | | `tests/unit/test_navigate_wiring.py` | 7 | Boot non-régression (import, allowed types, handler callable) | | `tests/unit/test_navigate_handler_e2e.py` | 6 | E2e mocké (nominal, OCR miss, no screenshot, never-fail) | ## Smoke commands post-commit (à exécuter sur DGX après deploy) ```bash # 1. Boot serveur streaming — pas d'ImportError RPA_AUTH_DISABLED=true python -c "from agent_v0.server_v1 import api_stream; print('api_stream OK')" # 2. Types autorisés — navigate présent RPA_AUTH_DISABLED=true python -c "from agent_v0.server_v1.replay_engine import _ALLOWED_ACTION_TYPES, _SERVER_SIDE_ACTION_TYPES; print('navigate in ALLOWED:', 'navigate' in _ALLOWED_ACTION_TYPES); print('navigate in SERVER_SIDE:', 'navigate' in _SERVER_SIDE_ACTION_TYPES)" # 3. Handler callable RPA_AUTH_DISABLED=true python -c "from core.navigation import _handle_navigate_action; print('handler callable:', callable(_handle_navigate_action))" # 4. Tests non-regression (navigation + wiring) RPA_AUTH_DISABLED=true python -m pytest tests/unit/ -k "navigat or visual_verifier or grounding or visual_login or action_resolver or wiring or e2e" -v --tb=short # 5. Service rpa-streaming actif + health endpoint systemctl is-active rpa-streaming.service curl -s http://localhost:5005/health | python3 -m json.tool ``` ## Critères de rollback (si smoke échoue) | Critère | Action | |---------|--------| | `ImportError` sur `api_stream` | Rollback git — `git revert --no-edit ..HEAD` | | `"navigate"` absent des `_ALLOWED`/`_SERVER_SIDE` | Rollback — `git revert --no-edit ..HEAD` | | Handler non callable | Rollback — `git revert --no-edit ..HEAD` | | Tests wiring/e2e FAIL | Ne pas deploy — investiguer avant | | Serveur 5005 ne boote pas | `systemctl restart rpa-streaming` + vérifier logs | ## Données à préserver sur DGX (ne pas écraser) - `visual_workflow_builder/backend/instance/workflows.db` — **TRACKÉ par git** (modifié dans working tree). `git reset --hard` l'écraserait → **INTERDIT**. Backup obligatoire avant deploy. - `.env.local` — creds clinique (DASHBOARD_PASSWORD, RPA_VLM_MODEL) ## Procédure de rollback rapide ```bash # Étape 0 : NOTER SHA_PRE_DEPLOY avant le merge cd /home/aivanov/ai/rpa_vision_v3 SHA_PRE_DEPLOY=$(git rev-parse HEAD) # ← noter ce SHA avant git pull/merge # Backup workflows.db (tracké par git — ne jamais reset --hard) cp visual_workflow_builder/backend/instance/workflows.db /tmp/workflows.db.backup # Rollback : revert vers SHA pré-deploy git revert --no-edit ..HEAD # annule tout ce qui est arrivé APRÈS le SHA noté (pas HEAD~1 — core/navigation/__init__.py est nouveau, checkout échouerait) systemctl restart rpa-streaming rpa-vision-v3-api # Restaurer workflows.db runtime si besoin cp /tmp/workflows.db.backup visual_workflow_builder/backend/instance/workflows.db ``` > **⚠️ INTERDICTION** : `git reset --hard` est **INTERDIT** sur DGX — `workflows.db` est tracké par git et modifié dans le working tree. Un reset hard écraserait les données runtime. ## Statut - Build+TDD : **FAIT** (131 tests verts, 0 régression) - Plan déploiement : **FAIT v2** (4 corrections revue croisée Claude appliquées : service name, health URL, DGX path, rollback command + workflows.db tracking) - Commit : **EN ATTENTE GO Dom** (demain matin) - Deploy DGX : **EN ATTENTE GO Dom** (supervisé, serveur clinique live) — Qwen