veza/chat_exports/veza_ag_chat_3.md

307 lines
No EOL
7.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Chat Conversation
Note: _This is purely the output of the chat conversation and does not contain any raw data, codebase snippets, etc. used to generate the output._
### User Input
# 🛰️ **MISSION ANTIGRAVITY — PHASE 3 : VALIDATION FINALE, HARDENING TRANSSERVICES & PR-READINESS**
Nous venons de terminer PHASE 2 :
* Queue persistée PostgreSQL
* Monitoring réel (Chat / Stream)
* Nettoyage code mort
* Début du TODO/HACK sweep
* Mise à jour de la doc
La branche active :
```
remediation/full_audit_fix
```
Elle contient maintenant la totalité des commits P0/P1/P2, dont ceux liés à :
* persistent job queue (backend-worker)
* real metrics chat-server
* removal of dead stream-server encoder prototype
* updates to POST_REMEDIATION_REPORT.md and CHANGELOG.md
Je veux maintenant lancer **PHASE 3**, la phase finale avant merge :
un **audit intégral**, **cross-services**, **systémique**, et **bloquant** pour sassurer que tout est :
* robuste
* cohérent
* déployable
* monitorable
* sans régression
* documenté
* PR-ready
---
## 🎯 OBJECTIFS PHASE 3
### ✔️ **OBJECTIF 1 — Audit de cohérence inter-services**
Tu dois réaliser un audit complet du fonctionnement transverse :
* Backend ↔ Chat Server
* Backend ↔ Stream Server
* Chat ↔ Stream (événements / IDs / statuts)
* Cohérence des UUID, payloads, statuts, champs JSON
* Cohérence jobs → stream → sync → DB
* Cohérence JWT entre services (mêmes claims, mêmes exigences, même vérification)
* Vérifier que les États & Transitions décrits dans le rapport initial sont désormais robustes
* Vérifier que la queue persistée ne laisse **aucun état zombie** en base
* Vérifier que le monitoring expose bien toutes les métriques prévues
* Vérifier que `shutdown` est propre pour *les trois services*, en conditions normales et edge cases
Le résultat doit être intégré dans :
👉 `POST_REMEDIATION_REPORT.md` section **PHASE 3 — Cross-Service Coherence Analysis**
---
### ✔️ **OBJECTIF 2 — Audit de sécurité complet**
Tu dois vérifier :
#### 🔐 Backend API
* middleware auth
* gestion JWT
* validation JSON (via BindAndValidateJSON)
* workers : sécurité job payload
* absence de panic / unwrap dangereux
#### 🔐 Chat Server
* permissions systèmes
* validation réelle dans `security/mod.rs`
* authentification WebSocket
* gestion erreurs WS
* résistance au flood WS
#### 🔐 Stream Server
* sécurité du pipeline FFmpeg
* états job « orphelins »
* gestion des erreurs de transcoding
* propagation correcte des statuts
* validation des inputs user → transcoding
Le tout doit être synthétisé dans :
👉 `POST_REMEDIATION_REPORT.md` section **Security Hardening Findings**
---
### ✔️ **OBJECTIF 3 — TODO/FIXME/HACK Sweep complet (final)**
Tu dois :
1. scanner **tout le repo**
2. extraire tous les TODO/FIXME/XXX/HACK restants
3. générer le fichier :
```
docs/TODO_TRIAGE_VEZA.md
```
4. trier chaque item selon :
* P1 = à corriger immédiatement dans cette branche
* P2 = acceptable mais à corriger avant release RC
* P3 = acceptable à long terme (archiver dans backlog)
5. appliquer les corrections P1 et **un commit par correctif**
6. mettre à jour :
* `POST_REMEDIATION_REPORT.md`
* `CHANGELOG.md`
---
### ✔️ **OBJECTIF 4 — Préparer une PR propre de fin de mission**
À la fin :
Créer un fichier :
```
docs/PR_READY_CHECKLIST.md
```
Avec :
* Checklist CI
* Checklist migrations DB
* Checklist tests Go
* Checklist tests Rust
* Checklist monitoring (targets Prometheus)
* Checklist sécurité JWT
* Checklist Frontend (si impact)
* Résumé des modifications majeures
* Risques connus restants
* Instructions de déploiement
---
### ✔️ **OBJECTIF 5 — CI MINIMALE AUTOMATISÉE**
Produire (dans `.github/workflows/`) un pipeline :
* `go test ./...`
* `go build`
* `cargo build --workspace`
* `cargo test --workspace`
* `cargo fmt --check`
* `go vet`
* vérification des migrations PostgreSQL (via `psql --dry-run` ou script SQL)
* vérification des schémas HCL / JSON sil y en a
Fichier attendu :
```
.github/workflows/ci.yml
```
---
### ✔️ **OBJECTIF 6 — Rapport de clôture PHASE 3**
Mettre à jour :
* `POST_REMEDIATION_REPORT.md`
* `CHANGELOG.md`
Et générer un fichier final :
```
PHASE_3_CLOSURE.md
```
Contenant :
* résumé des travaux PHASE 1 → PHASE 2 → PHASE 3
* état final du code
* vérification exhaustive de la santé des trois services
* feuille de route post-merge
* validité de la merge-request
---
## 🔁 **CONTRAINTES**
* **1 problème = 1 commit**
* commits conventionnels
* rien ne doit être mélangé
* suivre le même workflow que la Phase 2
* corrections testées & validées
* documentation mise à jour systématiquement
---
## 📦 **SORTIE FINALE ATTENDUE**
À la fin de PHASE 3, je veux :
* Une branche `remediation/full_audit_fix` **PR-ready**
* Tous les systèmes **cohérents**, **monitorés**, **stables**, **safe**
* Une CI opérationnelle
* Une documentation à jour
* Un rapport de remédiation complet
* Un repo propre, sans code fantôme ni TODO critique
---
### 🧨 Lancer maintenant PHASE 3
Commence immédiatement par :
1. Lire `REPORT_STATUS_2025_12_06.md`
2. Lire toutes les sorties PHASE 2
3. Scanner tous les services pour les incohérences inter-services
4. Proposer la première liste de tâches PHASE 3, triées par priorité
---
Tu peux maintenant exécuter PHASE 3.
*User accepted the command `git status`*
*Viewed [REPORT_STATUS_2025_12_06.md](file:///home/senke/Documents/veza/REPORT_STATUS_2025_12_06.md) *
*Viewed [POST_REMEDIATION_REPORT.md](file:///home/senke/Documents/veza/POST_REMEDIATION_REPORT.md) *
*Viewed [CHANGELOG.md](file:///home/senke/Documents/veza/CHANGELOG.md) *
*Listed directory [veza](file:///home/senke/Documents/veza) *
*Grep searched codebase*
*Viewed [mod.rs](file:///home/senke/Documents/veza/veza-chat-server/src/security/mod.rs) *
*Viewed [sync.rs](file:///home/senke/Documents/veza/veza-stream-server/src/core/sync.rs) *
*Viewed [job_worker.go](file:///home/senke/Documents/veza/veza-backend-api/internal/workers/job_worker.go) *
*Searched filesystem*
*Searched filesystem*
*User accepted the command `cargo check`*
*Listed directory [src](file:///home/senke/Documents/veza/veza-chat-server/src) *
*Viewed [jwt_service.go](file:///home/senke/Documents/veza/veza-backend-api/internal/services/jwt_service.go) *
*Checked command status*
*Viewed [jwt_manager.rs](file:///home/senke/Documents/veza/veza-chat-server/src/jwt_manager.rs) *
*Searched filesystem*
*User accepted the command `ps aux | grep postgres`*
*Edited relevant file*
*Edited relevant file*
### User Input
This is a system-generated message that is sent due to the user's review policy. Proceed with the decision that you think is the most optimal here.
*Edited relevant file*
*Edited relevant file*
*Edited relevant file*
*Edited relevant file*
*Viewed [job_worker.go](file:///home/senke/Documents/veza/veza-backend-api/internal/workers/job_worker.go) *
*Edited relevant file*
*Searched filesystem*
*Edited relevant file*
*Grep searched codebase*
*Edited relevant file*
*Edited relevant file*
*Edited relevant file*
*Edited relevant file*
*Edited relevant file*
*Viewed [ci.yml](file:///home/senke/Documents/veza/.github/workflows/ci.yml) *