4.9 KiB
4.9 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | |
|---|---|---|---|---|---|---|---|---|
| TASK-171 | Validate Stats section with backend data | done | platform | Frontend Senior |
|
foundation | medium |
TASK-171 - Validate Stats section with backend real data
Goal
Validate the Stats section end-to-end against local backend and data sources without introducing new features.
Context
The previous tasks already implemented player search, player profile, annual ranking endpoint, and the Stats frontend page.
Maintain the current product identity: Spanish-speaking HLL Vietnam community, military/Vietnam/tactical/sober visual direction and controlled repository evolution.
Steps
- Confirm git status before starting validation and verify pre-existing local frontend files.
- Read required files first (AGENTS + docs + frontend/backend files for Stats).
- Validate backend endpoints when available:
- GET /health
- GET /api/stats/players/search?q=
- GET /api/stats/players/{player_id}
- GET /api/stats/rankings/annual?year=&server_id=all&metric=kills&limit=20
- Serve or open
frontend/stats.htmland validate UI states. - Run required checks:
node --check frontend/assets/js/stats.jspowershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1(if applicable)
- Record validation results and keep any changes within minimal scope.
- If a small Stats-specific bug is found, patch it.
Files to Read First
- AGENTS.md
- ai/repo-context.md
- ai/architecture-index.md
- docs/stats-section-functional-plan.md
- frontend/stats.html
- frontend/assets/js/stats.js
- backend/app/routes.py
- backend/app/rcon_historical_player_stats.py
- backend/app/rcon_historical_leaderboards.py
- backend/app/rcon_annual_rankings.py
Expected Files to Modify
- ai/tasks/done/TASK-171-validate-stats-section-with-backend-data.md
- (Optional)
frontend/assets/js/stats.jsorfrontend/stats.htmlonly for minimal Stats-specific bug fixes.
Constraints
- No new features.
- No visual redesign.
- Do not touch
frontend/assets/js/partida-actual.js. - Do not touch
frontend/assets/img/clans/bxb.png. - Do not reactivate Elo/MMR.
- Do not reintroduce Comunidad Hispana #03.
- Do not modify historical workers.
- Do not modify DB unless a migration follow-up is explicitly required.
Validation
Before completing, ensure:
- backend endpoints were tested where possible.
- frontend runtime states were checked.
node --check frontend/assets/js/stats.js.scripts/run-integration-tests.ps1executed when available.git diff --name-onlychecked if modifications were made.
Outcome
Status: completed
Files read
- AGENTS.md
- ai/repo-context.md
- ai/architecture-index.md
- docs/stats-section-functional-plan.md
- frontend/stats.html
- frontend/assets/js/stats.js
- backend/app/routes.py
- backend/app/rcon_historical_player_stats.py
- backend/app/rcon_historical_leaderboards.py
- backend/app/rcon_annual_rankings.py
Endpoints probados
GET /health-> 200GET /api/stats/players/search?q=rambo-> 200 (items empty)GET /api/stats/players/76561198350628987?timeframe=weekly-> 200GET /api/stats/rankings/annual?year=2026&server_id=all&metric=kills&limit=20-> 200,snapshot_status="ready"GET /api/stats/rankings/annual?year=1990&server_id=all&metric=kills&limit=3-> 200, ready and emptyGET /api/stats/rankings/annual?year=2040&server_id=all&metric=kills&limit=20-> 200,snapshot_status="missing",items=[]GET /api/stats/rankings/annual?year=2026&metric=deaths&limit=20-> 400 (Invalid metric parameter)
Respuestas y estado visual
- Health and payload endpoints responded correctly.
- Search can return empty set with local dataset.
- Player profile endpoint returns weekly/monthly ranking payloads and allows runtime rendering.
- Annual ranking endpoint returns ready/empty and missing states as expected.
frontend/stats.htmlandfrontend/assets/js/stats.jswere served with HTTP 200.node --check frontend/assets/js/stats.jspassed.- Browser interactive runtime error checks could not be executed in this environment.
Validaciones ejecutadas
node --check frontend/assets/js/stats.jspowershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1- local backend started and queried via endpoints
- local static server started and
stats.html/stats.jsfetched successfully
Validaciones pendientes / limitaciones
- No se dispuso de DB con jugadores de prueba para validar search con resultados positivos y render completo en UI.
- No se hizo comprobacion interactiva de "backend no disponible" en navegador real.
Archivos modificados
ai/tasks/in-progress/TASK-171-validate-stats-section-with-backend-data.md
Siguiente task recomendada
- Añadir smoke test de UI con navegador/headless para validar estados runtime de
stats.jsy errores de backend en integración local.