docs(poc): share dgx spark readiness context

This commit is contained in:
Dom
2026-06-01 10:37:00 +02:00
parent 6a300a4298
commit 8b6c397531
6 changed files with 840 additions and 0 deletions

View File

@@ -0,0 +1,207 @@
# Ménage pré-POC — Plan d'exécution
**Date** : 2026-05-29
**Objectif** : rendre le projet `rpa_vision_v3` propre, lisible et portable sur DGX Spark avant déploiement clinique J+15.
**Scénario retenu** : **médian** — tri code/tests/docs + archivage modules orphelins, sans ajout de nouveaux tests POC critiques (dette POC acceptée).
## Photo de départ
| Élément | Valeur |
|---------|--------|
| Taille totale | 112 Go |
| Fichiers Python | 44 172 |
| Tests | 273 fichiers, ~98 K lignes |
| Markdown | 1 149 fichiers (160 racine `docs/`) |
| Modules `core/` orphelins | 21 / 41 |
| Git non commité au démarrage | 79 untracked + 49 modifiés |
## Décisions validées (2026-05-29)
1. **`agent_v0/agent_v1/` (client Windows Léa) sort du repo principal** → repo dédié `agent_v1_windows_client`. Cycle de release indépendant (déjà géré par SCP auto `feedback_scp_auto_modif_client_windows`). Le DGX ne le porte pas.
2. **Tests POC critiques manquants** (ollama_client, vlm_config, dialog_handler) **non ajoutés en POC** — dette POC explicite, chantier post-POC.
3. **Politique archivage** : branche dédiée `cleanup/pre-poc-2026-05-29`, commit unique par phase, rollback possible. Pas de suppression bourrine — tout est archivé dans `archive/` ou `_legacy/` selon la nature.
4. **Filtrage transfert DGX** : `data/` (27 Go RGPD), `logs/`, `htmlcov/`, `_archive/`, `archive/`, `output/`, venvs, `agent_rust/`, `models/*` lourds **ne partent pas** sur DGX.
## Plan d'exécution — 9-10 j-h sur 15 j calendrier
Branche : `cleanup/pre-poc-2026-05-29`
Commits : un par phase avec préfixe `chore(cleanup):`
### Phase F — Git cleanup (1 j) — **À FAIRE EN PREMIER**
Pré-requis avant tout autre tri. État : 79 untracked + 49 modifiés.
- [ ] `git status --short` → catégoriser : à commit, à stash, à supprimer
- [ ] Commit le pertinent (1 ou plusieurs commits thématiques)
- [ ] Stash l'expérimental sur branche dédiée `experimental/<topic>`
- [ ] Supprimer fichiers morts confirmés
- [ ] `pending_uncommitted_files.md` à jour ou supprimé après tri
### Phase A — Filtrage transfert DGX (0,5 j)
- [ ] Créer `.dgxignore` ou `tar --exclude-from=`:
- `data/`, `logs/`, `htmlcov/`, `output/`, `_archive/`, `archive/`
- `venv_v3/`, `.venv/`, `node_modules/`
- `agent_rust/` (Rust pas dans le POC)
- `models/` sauf liste explicite POC
- `*.pyc`, `__pycache__/`, `.pytest_cache/`, `.ruff_cache/`, `.vite/`
- [ ] Test tarball local : mesurer taille résultante (cible < 5 Go)
### Phase B — Code `core/` orphelin (2-3 j)
Cible : `archive/core_v3_projections_2026-05-29/`
Modules à archiver (21) : `analytics`, `capture`, `coaching`, `cognition`, `corrections`, `data`, `evaluation`, `extraction`, `gpu`, `healing`, `interfaces`, `monitoring`, `persistence`, `precision`, `security`, `supervision`, `system`, `training`, `variants`, `visual`
Méthode :
- [ ] Pour chaque module : `grep -r "from core.<module>" --include="*.py" .` → vérifier zéro import depuis points d'entrée actifs (api_stream, replay_engine, workflow_pipeline, VWB backend)
- [ ] Documenter dans `archive/core_v3_projections_2026-05-29/README.md` : raison d'archivage, modules dépendants éventuels, plan de réintégration possible
- [ ] `git mv` pour préserver l'historique
- [ ] Lancer fast suite → vérifier rien n'est cassé
Modules **gardés** (17 actifs) : `anonymisation`, `auth`, `detection`, `embedding`, `execution`, `federation`, `graph`, `grounding`, `knowledge`, `learning`, `llm`, `matching`, `models`, `pipeline`, `validation`, `vision`, `workflow`
### Phase C — Doublons code (1-1,5 j)
- [ ] **Consolider `config.py`** :
- Source de vérité : `core/config.py`
- Supprimer `agent_v0/config.py` (58 L), import depuis core
- `agent_v0/agent_v1/config.py` (101 L) → suit phase H (externalisation)
- [ ] **Fusionner models orphelins** :
- `core/corrections/models.py` (480 L) → archive (corrections est orphelin)
- `core/system/models.py` (340 L) → archive (system est orphelin)
- Pas de fusion nécessaire si les deux partent en archive — vérifier qu'aucun module actif ne les importe
- [ ] **Sortir `agent_v0/agent_v1/`** vers repo dédié (voir phase H)
### Phase D — Tests (2 j, sans ajout)
- [ ] Diagnostic full : `pytest --collect-only 2>&1 | tee /tmp/pytest_collect.log` → identifier import errors, xfail cascade
- [ ] Archiver tests orphelins → `archive/tests_orphan_2026-05-29/` :
- `tests/unit/test_cognition_dataclasses.py`
- `tests/unit/test_learning_pack.py`
- `tests/unit/test_pii_blur.py`
- `tests/unit/test_extraction_engine.py`
- `tests/unit/test_process_mining_bridge.py` (xfail)
- `tests/unit/test_circular_imports.py` (xfail)
- `tests/property/test_analytics_properties.py` (620 L xfail)
- [ ] Supprimer tests cassés irrécupérables :
- `tests/test_cross_frame_cache.py`
- `tests/test_visual_rpa_checkpoint.py` (661 L, imports `core.visual` manquants)
- [ ] À investiguer avant action :
- `tests/property/test_self_healing_properties.py` (~450 L, healing orphelin)
- 4 fichiers `test_learning_*.py` (~800 L, learning module statut à confirmer)
- [ ] Valider fast suite reste verte : `pytest tests/test_pipeline_e2e.py tests/test_phase0_integration.py -q`
- [ ] Documenter dette POC dans `docs/POC/DETTE_POC.md` : 3 tests manquants (ollama_client, vlm_config, dialog_handler) à ajouter post-POC
### Phase E — Docs (1 j)
Cible structure DGX :
```
docs/
├─ POC/ (gardé — actif)
├─ architecture/ (gardé)
├─ reference/ (gardé)
├─ guides/ (gardé)
├─ README.md, STATUS.md, CI_SETUP.md, OLLAMA_INTEGRATION.md, PLAYBOOK_DSI_RSSI.md
└─ archive/
├─ audits/ (17 AUDIT_*, BENCH_*, ANALYSE_*)
├─ sessions/ (12 HANDOFF_*, SESSION_*)
├─ plans/ (10 PLAN_*, VISION_*, ROADMAP_*)
├─ tasks-logs/ (71 TACHE_*, PHASE_*, RESOLUTION_*)
├─ brouillons/ (44 divers)
└─ coordination-logs/ (567 fichiers coordination/)
```
- [ ] Script de tri par préfixe (`AUDIT_*``archive/audits/`, etc.)
- [ ] Déduplication doublons identifiés (3 groupes : CORRECTION_FINALE_TYPESCRIPT_VWB, RESOLUTION_FINALE_PALETTE, RESUME_FINAL_PHASE_2)
- [ ] QA liens internes (sed sur les chemins déplacés)
### Phase G — Requirements ARM (0,5 j)
- [ ] Désépingler tous les `nvidia-*-cu12` du `requirements.txt`
- [ ] Créer `requirements-server.txt` (sans PyQt5, mss, pyautogui, pynput, evdev, python-xlib)
- [ ] Garder `requirements-dev.txt` pour le poste Dom
- [ ] Vérifier coherence avec `setup.py`
### Phase H — Externalisation `agent_v0/agent_v1/` (incluse dans 1 j de Phase C)
- [ ] Créer nouveau repo Gitea `agent_v1_windows_client`
- [ ] `git subtree split --prefix=agent_v0/agent_v1 -b extract-agent-v1` pour préserver l'historique
- [ ] Push vers nouveau repo
- [ ] Supprimer `agent_v0/agent_v1/` du repo principal
- [ ] Mettre à jour `feedback_scp_auto_modif_client_windows` (chemin source change)
- [ ] Mettre à jour `tests/integration/conftest.py` (le workaround sur `agent_v0` n'est plus nécessaire)
### Validation finale (0,5 j)
- [ ] Fast suite verte : `pytest tests/test_pipeline_e2e.py tests/test_phase0_integration.py tests/integration/test_stream_processor.py -m "not slow" -q`
- [ ] Smoke test pipeline complet (mockup local)
- [ ] Tarball test avec `.dgxignore` → mesure taille
- [ ] PR ou merge sur main avec changelog clair
## Branche et commits
```
git checkout -b cleanup/pre-poc-2026-05-29
# Phase F : Git cleanup
git commit -m "chore(cleanup): trier 79 untracked + 49 modifiés pré-POC"
# Phase A : Filtrage transfert
git commit -m "chore(cleanup): ajouter .dgxignore pour transfert DGX"
# Phase B : core orphelins
git commit -m "chore(cleanup): archiver 21 modules core orphelins vers archive/core_v3_projections_2026-05-29"
# Phase C : Doublons
git commit -m "chore(cleanup): consolider config.py + sortir agent_v1 vers repo dédié"
# Phase D : Tests
git commit -m "chore(cleanup): archiver tests orphelins + supprimer tests cassés irrécupérables"
# Phase E : Docs
git commit -m "chore(cleanup): restructurer docs/ en archive/ par catégorie"
# Phase G : Requirements
git commit -m "chore(cleanup): désépingler nvidia-cu12 + split requirements-server.txt"
# Validation
git commit -m "chore(cleanup): valider fast suite + tarball DGX < 5Go"
```
Merge sur `main` à la fin uniquement si validation OK. Si problème → rollback ciblé par phase (`git revert <hash>`).
## Rollback plan
- Branche `cleanup/pre-poc-2026-05-29` reste intacte pendant le POC
- Modules archivés sont `git mv`, historique préservé → restauration en 1 commit
- Tag git `pre-cleanup-2026-05-29` posé sur `main` AVANT la branche cleanup
- En cas de besoin de récupérer un orphelin : `git checkout <tag> -- core/<module>`
## Dette POC explicite
À traiter après stabilisation POC clinique :
1. **Tests POC critiques manquants** : ollama_client (1 → 5+), vlm_config (1 → 4+), dialog_handler (0 → 3+)
2. **Modules orphelins** : revue cas par cas pour rebrancher ou supprimer définitivement
3. **Refacto profond doublons models** : `core/corrections/models.py` vs `core/system/models.py` (si rebranchés post-POC)
4. **Migration `OllamaClient` → `VLMClient` multi-backend** (cf. `PORTAGE_DGX_SPARK_2026-05-28` §3)
## Décisions
| # | Décision | Date |
|---|----------|------|
| 1 | Scénario médian retenu, ~9-10 j-h | 2026-05-29 |
| 2 | `agent_v0/agent_v1/` sort dans repo dédié `agent_v1_windows_client` | 2026-05-29 |
| 3 | Tests POC critiques (ollama_client, vlm_config, dialog_handler) acceptés en dette POC | 2026-05-29 |
| 4 | Politique archivage : branche `cleanup/pre-poc-2026-05-29`, commit par phase, tag `pre-cleanup-2026-05-29` sur main | 2026-05-29 |
| 5 | `data/`, `logs/`, `htmlcov/`, `archive/`, `_archive/`, `output/`, `agent_rust/`, `models/*` lourds ne partent pas sur DGX | 2026-05-29 |
| 6 | 17 modules `core/*` gardés actifs, 21 archivés | 2026-05-29 |
| 7 | `web_dashboard/` inclus dans le périmètre DGX — **interface de pilotage centrale** (admin modèles, prompts, supervision), pas un nice-to-have | 2026-05-29 |
| 8 | Amina = source de vérité métier (codage médical) **uniquement**. Ne participe pas au code, au tri, au déploiement. Dom (+ assistant technique) exécute la transformation en programme | 2026-05-29 |
## Questions ouvertes
- Quand démarrer ? (en parallèle de la prep DGX semaine 2026-06-01 ou avant ?)
- Politique de tag : `pre-cleanup-2026-05-29` ou autre nomenclature préférée ?
- `agent_chat/` (692 K, 7 678 L) : maintenu en POC ou archivé ? À trancher Phase B