veza/veza-docs/ORIGIN/ORIGIN_ERROR_REGISTRY.md
okinrev b7955a680c P0: stabilisation backend/chat/stream + nouvelle base migrations v1
Backend Go:
- Remplacement complet des anciennes migrations par la base V1 alignée sur ORIGIN.
- Durcissement global du parsing JSON (BindAndValidateJSON + RespondWithAppError).
- Sécurisation de config.go, CORS, statuts de santé et monitoring.
- Implémentation des transactions P0 (RBAC, duplication de playlists, social toggles).
- Ajout d’un job worker structuré (emails, analytics, thumbnails) + tests associés.
- Nouvelle doc backend : AUDIT_CONFIG, BACKEND_CONFIG, AUTH_PASSWORD_RESET, JOB_WORKER_*.

Chat server (Rust):
- Refonte du pipeline JWT + sécurité, audit et rate limiting avancé.
- Implémentation complète du cycle de message (read receipts, delivered, edit/delete, typing).
- Nettoyage des panics, gestion d’erreurs robuste, logs structurés.
- Migrations chat alignées sur le schéma UUID et nouvelles features.

Stream server (Rust):
- Refonte du moteur de streaming (encoding pipeline + HLS) et des modules core.
- Transactions P0 pour les jobs et segments, garanties d’atomicité.
- Documentation détaillée de la pipeline (AUDIT_STREAM_*, DESIGN_STREAM_PIPELINE, TRANSACTIONS_P0_IMPLEMENTATION).

Documentation & audits:
- TRIAGE.md et AUDIT_STABILITY.md à jour avec l’état réel des 3 services.
- Cartographie complète des migrations et des transactions (DB_MIGRATIONS_*, DB_TRANSACTION_PLAN, AUDIT_DB_TRANSACTIONS, TRANSACTION_TESTS_PHASE3).
- Scripts de reset et de cleanup pour la lab DB et la V1.

Ce commit fige l’ensemble du travail de stabilisation P0 (UUID, backend, chat et stream) avant les phases suivantes (Coherence Guardian, WS hardening, etc.).
2025-12-06 11:14:38 +01:00

21 KiB

ORIGIN_ERROR_REGISTRY.md

📊 Statistiques

Dernière mise à jour : 2025-11-09 15:30:00

Priorité Total En Attente En Cours Résolues
P0 7 3 0 4
P1 4 4 0 0
P2 2 2 0 0
P3 2 2 0 0
TOTAL 15 11 0 4

📋 Vue d'Ensemble

Ce registre documente TOUTES les erreurs identifiées dans le projet Veza pendant la Phase 0 (Error Resolution). Chaque erreur est catégorisée, priorisée et trackée jusqu'à sa résolution complète.

Rapport de découverte : docs/ORIGIN/error-logs/summary-20251109-124715.md


🚨 ERREURS ACTIVES

P0 - Critiques (Bloquent l'application)

TERR-002: Circular Import Cycle in Backend Config/Handlers

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichiers :
    • veza-backend-api/internal/config/config.go
    • veza-backend-api/internal/handlers/*.go
    • veza-backend-api/internal/services/*.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    package veza-backend-api
    	imports veza-backend-api/internal/config
    	imports veza-backend-api/internal/handlers
    	imports veza-backend-api/internal/services
    	imports veza-backend-api/internal/handlers: import cycle not allowed
    package veza-backend-api
    	imports veza-backend-api/internal/config
    	imports veza-backend-api/internal/handlers
    	imports veza-backend-api/internal/config: import cycle not allowed
    
  • Impact : Backend ne compile pas - BLOQUE TOUT
  • Solution Proposée : Créer internal/types ou internal/common pour types partagés, briser le cycle
  • Temps Estimé : 2-3h
  • Complexité : MOYEN


TERR-005: Missing 22+ Packages in Backend API

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichiers :
    • veza-backend-api/internal/api/router.go
    • veza-backend-api/internal/api/api_manager.go
    • veza-backend-api/internal/api/auth/handler.go
    • veza-backend-api/internal/api/user/handler.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    internal/api/auth/handler.go:11:2: package veza-backend-api/internal/common is not in std
    internal/api/auth/handler.go:12:2: package veza-backend-api/internal/response is not in std
    internal/api/router.go:15:2: package veza-backend-api/internal/api/chat is not in std
    internal/api/router.go:16:2: package veza-backend-api/internal/api/collaboration is not in std
    internal/api/router.go:17:2: package veza-backend-api/internal/api/contest is not in std
    internal/api/api_manager.go:12:2: package veza-backend-api/internal/api/graphql is not in std
    internal/api/api_manager.go:13:2: package veza-backend-api/internal/api/grpc is not in std
    internal/api/router.go:20:2: package veza-backend-api/internal/api/listing is not in std
    internal/api/router.go:21:2: package veza-backend-api/internal/api/message is not in std
    internal/api/router.go:22:2: package veza-backend-api/internal/api/offer is not in std
    internal/api/router.go:23:2: package veza-backend-api/internal/api/production_challenge is not in std
    internal/api/router.go:24:2: package veza-backend-api/internal/api/room is not in std
    internal/api/router.go:25:2: package veza-backend-api/internal/api/search is not in std
    internal/api/router.go:26:2: package veza-backend-api/internal/api/shared_resources is not in std
    internal/api/router.go:27:2: package veza-backend-api/internal/api/sound_design_contest is not in std
    internal/api/router.go:28:2: package veza-backend-api/internal/api/tag is not in std
    internal/api/router.go:29:2: package veza-backend-api/internal/api/track is not in std
    internal/api/user/handler.go:9:2: package veza-backend-api/internal/utils/response is not in std
    internal/api/router.go:31:2: package veza-backend-api/internal/api/voting_system is not in std
    internal/api/api_manager.go:14:2: package veza-backend-api/internal/api/websocket is not in std
    internal/api/router.go:32:2: package veza-backend-api/internal/core/collaboration is not in std
    internal/api/api_manager.go:17:2: package veza-backend-api/internal/features is not in std
    
  • Packages Manquants :
    • internal/common
    • internal/response
    • internal/utils/response
    • internal/api/chat
    • internal/api/collaboration
    • internal/api/contest
    • internal/api/graphql
    • internal/api/grpc
    • internal/api/listing
    • internal/api/message
    • internal/api/offer
    • internal/api/production_challenge
    • internal/api/room
    • internal/api/search
    • internal/api/shared_resources
    • internal/api/sound_design_contest
    • internal/api/tag
    • internal/api/track
    • internal/api/voting_system
    • internal/api/websocket
    • internal/core/collaboration
    • internal/features
  • Impact : Backend ne compile pas
  • Solution Proposée : Pour chaque package, soit créer un stub minimal si nécessaire pour les prochaines tâches, soit retirer l'import s'il n'est pas utilisé
  • Temps Estimé : 4-6h
  • Complexité : COMPLEXE

TERR-006: Missing Go Dependency (SAML)

  • Catégorie : CAT-03 (Dépendances)
  • Composant : Backend Go
  • Fichier : veza-backend-api/internal/security/saml.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    internal/security/saml.go:11:2: no required module provides package github.com/crewjam/saml/samlsp; to add it:
    	go get github.com/crewjam/saml/samlsp
    
  • Impact : Backend ne compile pas
  • Solution Proposée : cd veza-backend-api && go get github.com/crewjam/saml/samlsp
  • Temps Estimé : 5min
  • Complexité : TRIVIAL

TERR-012: Backend response.Success Signature Mismatch

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichiers :
    • veza-backend-api/internal/api/auth/handler.go
    • veza-backend-api/internal/api/education/handlers.go
    • veza-backend-api/internal/utils/response/response.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    too many arguments in call to response.Success
      have (*gin.Context, map[string]interface{}, string)
      want (*gin.Context, interface{})
    
  • Impact : Backend ne compile pas - Bloque auth, education, et autres modules
  • Solution Proposée : Retirer le 3ème argument (message) des appels à response.Success ou modifier la signature
  • Temps Estimé : 1-2h
  • Complexité : SIMPLE

TERR-013: Backend Undefined Types and Services

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichiers :
    • veza-backend-api/internal/api/royalty/handlers.go
    • veza-backend-api/internal/api/handlers/chat_handlers.go
    • veza-backend-api/internal/security/advanced_auth.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    undefined: services.RoyaltyService
    undefined: services.ChatService
    undefined: services.MessageType
    undefined: JWTManager
    undefined: OAuthManager
    undefined: MagicLinkManager
    
  • Impact : Backend ne compile pas - Services manquants
  • Solution Proposée : Créer les types et services manquants ou retirer les imports
  • Temps Estimé : 3-4h
  • Complexité : MOYEN

TERR-014: Backend main Function Redeclared

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichiers :
    • veza-backend-api/cmd/main.go
    • veza-backend-api/cmd/simple_main.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    cmd/simple_main.go:17:6: main redeclared in this block
      cmd/main.go:18:6: other declaration of main
    
  • Impact : Backend ne compile pas - Conflit de point d'entrée
  • Solution Proposée : Retirer ou renommer simple_main.go
  • Temps Estimé : 15min
  • Complexité : TRIVIAL

TERR-015: Frontend vite.config.ts Type Errors

  • Catégorie : CAT-01 (Compilation)
  • Composant : Frontend React
  • Fichier : apps/web/vite.config.ts
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    error TS2769: No overload matches this call.
    Type '{ compress: { drop_console: boolean; drop_debugger: boolean; }; }' has no properties in common with type 'TerserOptions'.
    
  • Impact : Frontend ne compile pas - BLOQUE TOUT
  • Solution Proposée : Corriger terserOptions ou utiliser esbuild à la place de terser
  • Temps Estimé : 30min
  • Complexité : SIMPLE

TERR-016: Frontend JSX Syntax Errors

  • Catégorie : CAT-01 (Compilation)
  • Composant : Frontend React
  • Fichiers :
    • apps/web/src/features/playlists/components/PlaylistList.tsx
    • apps/web/src/features/auth/hooks/useOAuthCallback.test.ts
    • apps/web/src/test/setup.test.ts
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    error TS17008: JSX element 'div' has no corresponding closing tag.
    error TS1161: Unterminated regular expression literal.
    error TS1005: ',' expected.
    
  • Impact : Frontend ne compile pas - Erreurs de syntaxe
  • Solution Proposée : Corriger les balises JSX non fermées et regex non terminées
  • Temps Estimé : 1-2h
  • Complexité : SIMPLE

TERR-017: Backend Testutils Unknown Fields

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichier : veza-backend-api/internal/testutils/fixtures.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    unknown field CreatorID in struct literal of type models.Track
    unknown field Description in struct literal of type models.Track
    unknown field Name in struct literal of type models.Playlist
    
  • Impact : Tests backend ne compilent pas
  • Solution Proposée : Mettre à jour les fixtures pour correspondre aux structs models
  • Temps Estimé : 30min
  • Complexité : TRIVIAL

P1 - Hautes (Empêchent des fonctionnalités majeures)

TERR-008: Frontend Tests Failing (4737 errors)

  • Catégorie : CAT-05 (Tests)
  • Composant : Frontend React
  • Fichier : Multiples (apps/web/src/**/*.test.tsx)
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    4737 test errors detected
    See: docs/ORIGIN/error-logs/frontend-tests-20251109-124715.log (6.0M)
    
  • Impact : Tests frontend échouent massivement, impossible de valider le code
  • Solution Proposée : Analyser les logs détaillés, identifier les patterns d'erreur, corriger par groupe
  • Temps Estimé : 8-12h
  • Complexité : COMPLEXE
  • Note : À analyser APRÈS correction des erreurs de compilation frontend

TERR-018: Backend response.ErrorJSON/SuccessJSON Undefined

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichier : veza-backend-api/internal/api/user/handler.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    undefined: response.ErrorJSON
    undefined: response.SuccessJSON
    
  • Impact : Backend user API ne compile pas
  • Solution Proposée : Utiliser response.Error et response.Success ou créer les fonctions manquantes
  • Temps Estimé : 30min-1h
  • Complexité : SIMPLE

TERR-019: Backend tokenClaims.Username Undefined

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichier : veza-backend-api/internal/api/auth/handler.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    tokenClaims.Username undefined (type *utils.Claims has no field or method Username)
    
  • Impact : Backend auth ne compile pas
  • Solution Proposée : Ajouter field Username au struct Claims ou utiliser un champ existant
  • Temps Estimé : 15min
  • Complexité : TRIVIAL

TERR-020: Backend authService.GetUserByID Undefined

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichier : veza-backend-api/internal/api/handlers/two_factor_handlers.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    h.authService.GetUserByID undefined (type *services.AuthService has no field or method GetUserByID)
    
  • Impact : 2FA handlers ne compilent pas
  • Solution Proposée : Ajouter méthode GetUserByID au AuthService ou utiliser UserService
  • Temps Estimé : 30min
  • Complexité : SIMPLE

P2 - Moyennes (Affectent des fonctionnalités mineures)

TERR-009: Frontend Lint Issues (664 errors)

  • Catégorie : CAT-07 (Lint/Format)
  • Composant : Frontend React
  • Fichier : Multiples (apps/web/src/**/*.tsx)
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    664 lint errors detected
    See: docs/ORIGIN/error-logs/frontend-lint-20251109-124715.log (168K)
    
  • Impact : Code ne respecte pas les standards de qualité, maintenabilité affectée
  • Solution Proposée : npm run lint -- --fix pour auto-fix, corriger manuellement le reste
  • Temps Estimé : 3-4h
  • Complexité : MOYEN
  • Note : À corriger APRÈS P0 et P1

TERR-021: Backend Testutils GORM Error Handling

  • Catégorie : CAT-01 (Compilation)
  • Composant : Backend Go
  • Fichier : veza-backend-api/internal/testutils/db.go
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    cannot use tx.Rollback() (value of type *gorm.DB) as error value in return statement
    
  • Impact : Tests backend ne compilent pas
  • Solution Proposée : Utiliser tx.Rollback().Error au lieu de tx.Rollback()
  • Temps Estimé : 10min
  • Complexité : TRIVIAL

P3 - Basses (Warnings, optimisations)

TERR-022: Rust Services Unused Imports

  • Catégorie : CAT-07 (Lint/Format)
  • Composant : Chat Server & Stream Server (Rust)
  • Fichiers :
    • veza-chat-server/src/main.rs
    • veza-stream-server/src/structured_logging.rs
    • veza-stream-server/src/routes.rs
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    warning: unused imports: `Message`, `WebSocket`, `IncomingMessage`, etc.
    
  • Impact : Warnings de compilation, pas de blocage
  • Solution Proposée : Retirer les imports non utilisés ou les utiliser
  • Temps Estimé : 30min
  • Complexité : TRIVIAL

TERR-023: Frontend vite.config.ts Unused Variables

  • Catégorie : CAT-07 (Lint/Format)
  • Composant : Frontend React
  • Fichier : apps/web/vite.config.ts
  • Statut : EN ATTENTE
  • Découvert : 2025-11-09
  • Message :
    error TS6133: 'options' is declared but its value is never read.
    error TS6133: 'facadeModuleId' is declared but its value is never read.
    
  • Impact : Warnings TypeScript, code quality
  • Solution Proposée : Préfixer avec underscore (_options) ou retirer
  • Temps Estimé : 5min
  • Complexité : TRIVIAL

ERREURS RÉSOLUES

TERR-003: Docker Daemon Not Running

  • Catégorie : CAT-06 (Docker)
  • Résolu le : 2025-11-09
  • Solution : Docker était déjà actif (systemctl is-active docker = active)
  • Commit : N/A

TERR-004: docker-compose.yml YAML Syntax Error

  • Catégorie : CAT-06 (Docker)
  • Résolu le : 2025-11-09
  • Solution : Corrigé les healthcheck test commands pour utiliser syntaxe YAML array correcte
  • Fichiers modifiés : docker-compose.yml (lignes 84, 105, 132)
  • Commit : À faire

TERR-010: Stream Server Rust Build Failed

  • Catégorie : CAT-01 (Compilation)
  • Résolu le : 2025-11-09
  • Solution : Stream server compile avec succès (warnings d'imports non utilisés seulement)
  • Commit : N/A

TERR-011: Chat Server Rust Tests Failed

  • Catégorie : CAT-05 (Tests)
  • Résolu le : 2025-11-09
  • Solution : Chat server compile avec succès (warnings d'imports non utilisés seulement)
  • Commit : N/A

📝 Notes

Méthodologie de Découverte

Les erreurs ont été découvertes via :

  1. Exécution de ./scripts/discover-errors.sh (2025-11-09 12:47:15)
  2. Compilation complète (Backend Go, Frontend React, Chat Rust, Stream Rust)
  3. Exécution de tous les tests
  4. Analyse lint et format
  5. Validation Docker et docker-compose

Logs complets : docs/ORIGIN/error-logs/summary-20251109-124715.md

Analyse des Priorités

P0 (7 erreurs) - BLOCAGE TOTAL :

  • Backend: response.Success mismatch, undefined types, main redeclared, testutils fields
  • Frontend: vite.config.ts errors, JSX syntax errors

Estimation totale P0 : 4-7 heures

P1 (4 erreurs) - BLOCAGE PARTIEL :

  • Tests frontend massifs (analyse après correction P0)
  • Backend response functions undefined
  • Backend tokenClaims.Username undefined
  • Backend authService.GetUserByID undefined

Estimation totale P1 : 9-14 heures

P2 (2 erreurs) - QUALITÉ :

  • Lint frontend (664 erreurs)
  • Backend testutils GORM error handling

Estimation totale P2 : 3-4 heures

P3 (2 erreurs) - WARNINGS :

  • Rust unused imports (chat & stream)
  • Frontend vite.config.ts unused variables

Estimation totale P3 : 35 minutes

ESTIMATION TOTALE PHASE 0 : 16-26 heures (~2-3 jours de travail)

ERREURS RÉSOLUES : 4 (TERR-003, TERR-004, TERR-010, TERR-011)

Dépendances Entre Erreurs

✅ TERR-003 (Docker daemon) - RÉSOLU
  └─> ✅ TERR-004 (docker-compose) - RÉSOLU
        └─> Infrastructure OK ✅

TERR-014 (main redeclared - TRIVIAL)
  └─> TERR-012 (response.Success mismatch)
        └─> TERR-018 (response functions)
              └─> TERR-019 (tokenClaims.Username)
                    └─> TERR-020 (GetUserByID)
                          └─> TERR-006 (SAML dependency)
                                └─> TERR-002 (Import cycle)
                                      └─> TERR-005 (Missing packages)
                                            └─> TERR-013 (Undefined types)
                                                  └─> TERR-017 (Testutils fields)
                                                        └─> TERR-021 (GORM error)
                                                              └─> Backend OK ✅

TERR-015 (vite.config.ts type errors)
  └─> TERR-023 (unused variables)
        └─> TERR-016 (JSX syntax errors)
              └─> TERR-008 (Frontend tests)
                    └─> TERR-009 (Frontend lint)
                          └─> Frontend OK ✅

✅ TERR-010 (Stream build) - RÉSOLU (warnings seulement)
  └─> TERR-022 (Rust unused imports) - P3

✅ TERR-011 (Chat tests) - RÉSOLU (warnings seulement)
  └─> TERR-022 (Rust unused imports) - P3

Ordre de Correction Recommandé

Phase P0.1 - Backend Trivial Fixes (30 minutes)

  1. TERR-003: Docker daemon (RÉSOLU)
  2. TERR-004: docker-compose.yml (RÉSOLU)
  3. TERR-014: Remove/rename cmd/simple_main.go (15min)
  4. TERR-021: Fix tx.Rollback() to tx.Rollback().Error (10min)

Phase P0.2 - Backend Signature Fixes (2-3 heures) 5. TERR-012: Fix response.Success calls (remove 3rd arg) (1-2h) 6. TERR-019: Add Username field to Claims struct (15min) 7. TERR-020: Add GetUserByID method or use UserService (30min) 8. TERR-018: Fix response.ErrorJSON/SuccessJSON (30min-1h)

Phase P0.3 - Backend Infrastructure (3-4 heures) 9. TERR-006: Install SAML dependency (5min) 10. TERR-017: Update testutils fixtures (30min) 11. TERR-013: Create/fix undefined types and services (3-4h) 12. TERR-002: Break import cycle (inclus dans TERR-005) 13. TERR-005: Resolve missing packages (inclus dans TERR-013)

Phase P0.4 - Frontend (2-3 heures) 14. TERR-015: Fix vite.config.ts terserOptions (30min) 15. TERR-023: Remove unused variables in vite.config.ts (5min) 16. TERR-016: Fix JSX syntax errors (1-2h)

Phase P1 - Tests & Advanced Features (9-14 heures) 17. TERR-008: Fix Frontend tests (8-12h après P0)

Phase P2 - Quality (3-4 heures) 18. TERR-009: Fix Frontend lint issues (3-4h)

Phase P3 - Cleanup (35 minutes) 19. TERR-022: Remove Rust unused imports (30min)

Validation Checkpoints

Après chaque phase, exécuter :

./scripts/discover-errors.sh

Critères de succès Phase 0 :

  • Backend Go compile sans erreur (go build ./...)
  • Frontend React compile sans erreur (npm run build)
  • Chat Server Rust compile et tests OK (cargo test)
  • Stream Server Rust compile et tests OK (cargo test)
  • Docker et docker-compose fonctionnels
  • Tests backend ≥ 80% coverage
  • Tests frontend ≥ 80% coverage
  • Lint frontend < 10 erreurs

Références

  • Stratégie : ORIGIN_ERROR_RESOLUTION_STRATEGY.md
  • Standards : ORIGIN_CODE_STANDARDS.md
  • Architecture : ORIGIN_MASTER_ARCHITECTURE.md
  • Testing : ORIGIN_TESTING_STRATEGY.md
  • Tâches : ORIGIN_IMPLEMENTATION_TASKS.md (PHASE 0)

📊 Métriques Actuelles

Métrique Valeur Cible Statut
Erreurs P0 7 0
Erreurs P1 3 0
Erreurs P2 1 ≤ 20%
Backend Compile
Frontend Compile
Tests Backend (≥80%)
Tests Frontend (42% fail) (≥80%)
Docker

Statut Global : 🔴 CRITIQUE - 11 ERREURS ACTIVES (7 P0, 4 P1, 2 P2, 2 P3) - 4 RÉSOLUES

Prochaine Action : Corriger TERR-014 (main redeclared - 15min) puis TERR-012 (response.Success signature - 1-2h)