veza/docs/archive/v0-history/AUDIT_103_CORRECTIONS.md
senke 0e7097ed1b chore(cleanup): J1 — purge 220MB debris, archive session docs (complete)
First-attempt commit 3a5c6e184 only captured the .gitignore change; the
pre-commit hook silently dropped the 343 staged moves/deletes during
lint-staged's "no matching task" path. This commit re-applies the intended
J1 content on top of bec75f143 (which was pushed in parallel).

Uses --no-verify because:
- J1 only touches .md/.json/.log/.png/binaries — zero code that would
  benefit from lint-staged, typecheck, or vitest
- The hook demonstrated it corrupts pure-rename commits in this repo
- Explicitly authorized by user for this one commit

Changes (343 total: 169 deletions + 174 renames):

Binaries purged (~167 MB):
- veza-backend-api/{server,modern-server,encrypt_oauth_tokens,seed,seed-v2}

Generated reports purged:
- 9 apps/web/lint_report*.json (~32 MB)
- 8 apps/web/tsc_*.{log,txt} + ts_*.log (TS error snapshots)
- 3 apps/web/storybook_*.json (1375+ stored errors)
- apps/web/{build_errors*,build_output,final_errors}.txt
- 70 veza-backend-api/coverage*.out + coverage_groups/ (~4 MB)
- 3 veza-backend-api/internal/handlers/*.bak

Root cleanup:
- 54 audit-*.png (visual regression baselines, ~11 MB)
- 9 stale MVP-era scripts (Jan 27, hardcoded v0.101):
  start_{iteration,mvp,recovery}.sh,
  test_{mvp_endpoints,protected_endpoints,user_journey}.sh,
  validate_v0101.sh, verify_logs_setup.sh, gen_hash.py

Session docs archived (not deleted — preserved under docs/archive/):
- 78 apps/web/*.md     → docs/archive/frontend-sessions-2026/
- 43 veza-backend-api/*.md → docs/archive/backend-sessions-2026/
- 53 docs/{RETROSPECTIVE_V,SMOKE_TEST_V,PLAN_V0_,V0_*_RELEASE_SCOPE,
          AUDIT_,PLAN_ACTION_AUDIT,REMEDIATION_PROGRESS}*.md
                        → docs/archive/v0-history/

README.md and CONTRIBUTING.md preserved in apps/web/ and veza-backend-api/.

Note: The .gitignore rules preventing recurrence were already pushed in
3a5c6e184 and remain in place — this commit does not modify .gitignore.

Refs: AUDIT_REPORT.md §11
2026-04-14 17:12:03 +02:00

5.3 KiB

Corrections par rapport à l'audit 103

Date : 16 février 2026
Référence : 103_audit_global_features_states.md
Objectif : Documenter les écarts entre l'audit et l'état réel du backend, sans modifier le fichier d'audit lui-même.


1. Module 6 — Social & Communauté

Audit (ligne 466) : « Le frontend a des composants Social mais ils appellent des endpoints qui n'existent pas dans le backend (uniquement MSW mocks) »

Correction : Le backend expose des routes Social dans veza-backend-api/internal/api/routes_social.go :

  • GET /api/v1/social/feed — flux social
  • GET /api/v1/social/posts/user/:user_id — posts par utilisateur
  • GET /api/v1/social/groups — liste des groupes
  • GET /api/v1/social/groups/:id — détail d'un groupe
  • POST /api/v1/social/posts — créer un post (protégé)
  • POST /api/v1/social/like — like (protégé)
  • POST /api/v1/social/comments — commenter (protégé)
  • POST /api/v1/social/groups — créer un groupe (protégé)
  • POST /api/v1/social/groups/:id/join — rejoindre un groupe (protégé)
  • DELETE /api/v1/social/groups/:id/leave — quitter un groupe (protégé)

2. Module 9 — Gestion de Matériel (Gear)

Audit (ligne 506) : « Le frontend a des composants via MSW mocks (/api/v1/inventory/gear), mais aucun endpoint backend n'existe »

Correction : Le backend expose des routes Gear dans veza-backend-api/internal/api/routes_gear.go :

  • GET /api/v1/inventory/gear — liste du matériel
  • POST /api/v1/inventory/gear — créer un équipement (protégé)
  • GET /api/v1/inventory/gear/:id — détail d'un équipement
  • PUT /api/v1/inventory/gear/:id — modifier (protégé)
  • DELETE /api/v1/inventory/gear/:id — supprimer (protégé)

3. Live Streams

Audit (ligne 135) : « GET /api/v1/live/streams/* — pas de routes live dans le backend »

Correction : Le backend expose des routes Live dans veza-backend-api/internal/api/routes_live.go :

  • GET /api/v1/live/streams — liste des streams
  • GET /api/v1/live/streams/:id — détail d'un stream
  • POST /api/v1/live/streams — créer un stream (protégé)

4. Routes Notifications

Audit : Le rapport 103 indique un backend « limité » pour les notifications.

Correction : Les routes /api/v1/notifications/* existent dans veza-backend-api/internal/api/routes_core.go (lignes 344-353) :

  • GET /api/v1/notifications — liste des notifications
  • GET /api/v1/notifications/unread-count — nombre de non lues
  • POST /api/v1/notifications/:id/read — marquer comme lue
  • POST /api/v1/notifications/read-all — tout marquer comme lu
  • DELETE /api/v1/notifications/:id — supprimer une notification
  • DELETE /api/v1/notifications — supprimer toutes les notifications

Phase 2.2 : Création automatique de notifications pour follow, like et comment (handlers ProfileHandler, TrackHandler, CommentHandler).


5. Job Queue (RabbitMQ)

Audit : Mention de job queue non connectée.

Correction : RabbitMQ est configuré et connecté via config.RabbitMQEventBus (veza-backend-api/internal/config/config.go). Le service démarre avec RabbitMQ si RABBITMQ_ENABLE=true. Le health check /readyz inclut RabbitMQ (mode dégradé si indisponible).


6. Stream Server — Callback HTTP

Audit : Référence au Stream Server.

Correction : Le backend expose un endpoint de callback pour le Stream Server :

  • POST /api/v1/internal/tracks/:id/stream-ready — callback après transcoding (authentifié par X-Internal-API-Key)
  • Également disponible en legacy : POST /internal/tracks/:id/stream-ready

7. Recherche unifiée

Audit (ligne 192) : « /search » listé comme inexistant.

Correction : La recherche unifiée existe dans veza-backend-api/internal/api/routes_search.go :

  • GET /api/v1/search — recherche unifiée (tracks, users, playlists)

8. Tests E2E Playwright

Prérequis : Backend API doit être démarré sur http://localhost:8080 pour les tests smoke/auth (login, upload, playlists).

Configuration :

  • PORT=5174 : évite conflit avec dev server sur 5173
  • playwright.config.ts : webServer timeout 5 min, Vite respecte process.env.PORT
  • vite.config.ts : server.port utilise process.env.PORT || 5173

Commande :

# Backend + Frontend requis
cd apps/web && PORT=5174 VITE_API_URL=http://localhost:8080/api/v1 npx playwright test --project=chromium

9. Analytics — track_plays.device

Vérification : La table track_plays possède bien la colonne device (modèle TrackPlay dans internal/models/track_play.go). Le handler GetDeviceBreakdown interroge correctement cette colonne. GetTrafficSources renvoie [] car track_plays n'a pas de colonne source — comportement documenté dans le handler.


10. Routes orphelines (backend exposé, frontend non consommateur)

Routes disponibles pour usage futur (pas de UI dédiée actuellement) :

  • POST /api/v1/tracks/initiate, POST /api/v1/tracks/complete, GET /api/v1/tracks/resume/:uploadId — upload chunked
  • POST /api/v1/tracks/batch/delete, POST /api/v1/tracks/batch/update — opérations batch
  • GET /api/v1/tracks/shared/:token — partage par token
  • GET /api/v1/users/me/export — export données utilisateur
  • POST /api/v1/audit/cleanup — nettoyage audit (admin)