3.2 KiB
3.2 KiB
id, title, status, type, team, supporting_teams, roadmap_item
| id | title | status | type | team | supporting_teams | roadmap_item | ||
|---|---|---|---|---|---|---|---|---|
| TASK-167 | Add annual ranking snapshot storage | pending | backend | Arquitecto de Base de Datos |
|
foundation |
TASK-167 - Add annual ranking snapshot storage
Goal
Implement storage primitives to persist annual top 20 player ranking snapshots, following the schema plan in docs/annual-ranking-snapshot-schema-plan.md, without adding generator logic or annual ranking APIs yet.
Context
TASK-166-design-annual-ranking-snapshot-schema.md defined the intended schema and constraints for:
rcon_annual_ranking_snapshotsrcon_annual_ranking_snapshot_items
This task creates the storage layer so future yearly ranking generators can run on top of materialized RCON data in SQLite and PostgreSQL-compatible paths.
The implementation must stay backend-only and must not touch frontend assets.
Steps
- Read all files listed below before any edit.
- Add snapshot table creation for both SQLite and PostgreSQL-compatible schema paths if present.
- Include SQLite/Postgres-safe DDL in migration-like storage initializer surfaces used by the project.
- Keep changes minimal and avoid endpoint or generator creation.
- Validate syntax/initialization and keep changed files within expected scope.
- Update task outcome once completed and move to
ai/tasks/doneonly after scope checks pass.
Files to Read First
AGENTS.mdai/repo-context.mdai/architecture-index.mddocs/annual-ranking-snapshot-schema-plan.mdbackend/app/rcon_admin_log_materialization.pybackend/app/postgres_rcon_storage.pybackend/app/sqlite_to_postgres_migration.pybackend/app/rcon_historical_leaderboards.pybackend/app/rcon_historical_player_stats.py
Expected Files to Modify
backend/app/rcon_admin_log_materialization.pyor equivalent materialized-RCON storage init modulebackend/app/postgres_rcon_storage.pyor equivalent PostgreSQL schema initializerbackend/app/sqlite_to_postgres_migration.pyif migration table lists and sequence sync require alignmentai/tasks/done/TASK-167-add-annual-ranking-snapshot-storage.md
Constraints
- No generador anual de ranking en este scope.
- No endpoint anual agregado aún.
- No modificaciones de frontend.
- No tocar
frontend/assets/js/partida-actual.js. - No tocar
frontend/assets/img/clans/bxb.png. - Mantener compatibilidad SQLite/Postgres si la capa existente ya la usa.
- No reactivar Elo/MMR.
- No reintroducir Comunidad Hispana #03.
- No ampliar
historical workerssalvo cambios estrictamente necesarios en inicialización de storage.
Validation
python -m compileall backend/appscripts/run-integration-tests.ps1(si aplica).- Validación de inicialización de storage para SQLite.
- Validación de compatibilidad SQL/DDL con Postgres en los módulos de compatibilidad existentes.
git diff --name-onlydebe mostrar sólo el alcance esperado.
Outcome
Documentar en el cierre de task:
- Archivos modificados.
- Tablas nuevas añadidas (
rcon_annual_ranking_snapshots,rcon_annual_ranking_snapshot_items). - Compatibilidad SQLite/Postgres.
- Validaciones ejecutadas.
- Limitaciones conocidas.
- Siguiente task recomendada: generador de snapshot anual top 20.