4.4 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | ||
|---|---|---|---|---|---|---|---|---|---|
| TASK-190-design-weekly-monthly-ranking-snapshots | Design weekly monthly ranking snapshots | done | documentation | Arquitecto de Base de Datos |
|
foundation | high |
TASK-190 - Design weekly monthly ranking snapshots
Goal
Design a weekly/monthly ranking snapshot read model, equivalent in philosophy to the annual snapshot model, so public ranking requests do not depend on expensive runtime aggregation.
Context
Annual ranking already follows a snapshot-backed read path, but weekly/monthly public ranking still depends on runtime aggregation over materialized match stats. HLL Vietnam needs a documented snapshot model for weekly and monthly ranking windows that preserves the current RCON-first policy, keeps annual behavior intact and defines a controlled fallback strategy during transition.
Preserve the current product identity: Spanish-speaking HLL Vietnam community, military/Vietnam/tactical/sober visual direction and controlled repository evolution.
Steps
- Read the listed files first.
- Use the performance audit and the annual snapshot runbook as reference points.
- Define the proposed tables, keys, metadata and item payload needed for weekly/monthly ranking snapshots.
- Define refresh cadence and lifecycle rules for current and closed windows.
- Define the public fallback policy without reintroducing heavy recomputation on every request.
Files to Read First
AGENTS.mdai/repo-context.mdai/architecture-index.mddocs/ranking-stats-performance-audit.mddocs/global-ranking-page-plan.mddocs/annual-ranking-snapshot-runbook.mdbackend/app/rcon_historical_leaderboards.pybackend/app/rcon_annual_rankings.py
Expected Files to Modify
docs/ranking-snapshot-read-model-plan.mdai/tasks/done/TASK-190-design-weekly-monthly-ranking-snapshots.md
Constraints
- Documentación-only.
- No modificar backend.
- No modificar frontend.
- No crear migraciones.
- No implementar snapshots todavía.
- No reactivar Elo/MMR.
- No reintroducir Comunidad Hispana #03.
- Mantener el diseño alineado con Python backend y con el snapshot anual existente.
Validation
Before completing the task ensure:
- the plan defines
ranking_snapshots - the plan defines
ranking_snapshot_items - the model covers:
timeframeweekly/monthly/annualserver_idmetricwindow_startandwindow_endgenerated_atsourcesnapshot_statusitem_countlimit_sizeranking_positionplayer_idplayer_namemetric_valuematches_consideredkillsdeathsteamkillskd_ratiokills_per_match
- the refresh policy is explicit:
- weekly current every 5-15 minutes
- monthly current every 15-30 minutes
- previous week/month closed and stable
- annual manual or daily
- the fallback policy is explicit:
- serve snapshot if present
- return controlled missing or use runtime fallback only by configuration if missing
- never recalculate by default on every public request
- the plan names impacted endpoints and expected response metadata
git diff --name-onlystays within scope
Outcome
- Snapshot design documented in
docs/ranking-snapshot-read-model-plan.md. - Proposed read model uses:
ranking_snapshotsranking_snapshot_items
- The plan explicitly covers:
timeframeweekly/monthly/annualserver_idmetricwindow_startwindow_endgenerated_atsourcesnapshot_statusitem_countlimit_size- per-item ranking and player fields
- Refresh policy defined:
- weekly current every
5to15minutes - monthly current every
15to30minutes - previous week/month stable once closed
- annual manual or daily
- weekly current every
- Fallback policy defined:
- serve snapshot when
ready - return controlled
missingor use runtime fallback only by configuration when snapshot is absent - never recalculate by default on every public request
- serve snapshot when
- Transition notes prepared for
TASK-191:- weekly/monthly snapshot-first read path
- annual remains on the existing annual snapshot implementation until a dedicated migration task consolidates storage
Change Budget
- Prefer fewer than 5 modified files.
- Prefer changes under 200 lines when feasible.
- Split the work into follow-up tasks if limits are exceeded.