Add ranking metric expansion
This commit is contained in:
@@ -0,0 +1,177 @@
|
||||
---
|
||||
id: TASK-184-define-ranking-metric-expansion-contract
|
||||
title: Define ranking metric expansion contract
|
||||
status: done
|
||||
type: documentation
|
||||
team: Analista
|
||||
supporting_teams:
|
||||
- PM
|
||||
- Backend Senior
|
||||
- Frontend Senior
|
||||
- Arquitecto de Base de Datos
|
||||
- Experto en interfaz
|
||||
roadmap_item: foundation
|
||||
priority: high
|
||||
---
|
||||
|
||||
# TASK-184-define-ranking-metric-expansion-contract - Define ranking metric expansion contract
|
||||
|
||||
## Goal
|
||||
|
||||
Define the functional and technical contract for expanding `Ranking global` with additional metrics in V1.1 without reactivating Elo/MMR or introducing a new architecture.
|
||||
|
||||
## Context
|
||||
|
||||
The current Ranking implementation is limited to `kills`. The repository already has a dedicated Ranking route, an RCON materialized weekly/monthly read path, and an annual snapshot read path. Before backend or frontend expansion, HLL Vietnam needs explicit documentation that defines which extra metrics are safe, how they are calculated, what timeframes they support, and where annual support must remain constrained.
|
||||
|
||||
Preserve the current product identity: Spanish-speaking HLL Vietnam community, military/Vietnam/tactical/sober visual direction and controlled repository evolution.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Read the listed files first.
|
||||
2. Update the Ranking contract documentation for V1.1 metric expansion only.
|
||||
3. Define the supported metrics and the formula or aggregation rule for each one.
|
||||
4. Define expected ordering for each metric and clarify tie-break behavior.
|
||||
5. Define supported timeframes per metric:
|
||||
- `weekly`
|
||||
- `monthly`
|
||||
- `annual`
|
||||
6. Clarify the difference between weekly/monthly runtime reads and annual snapshot reads.
|
||||
7. Clarify whether annual remains limited to `kills` or only allows additional metrics when a safe snapshot-backed read path already exists.
|
||||
8. Define payload expectations and controlled error behavior for unsupported metrics.
|
||||
9. Keep non-goals and source-policy restrictions explicit.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `AGENTS.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/architecture-index.md`
|
||||
- `docs/global-ranking-page-plan.md`
|
||||
- `docs/stats-section-functional-plan.md`
|
||||
- `docs/annual-ranking-snapshot-runbook.md`
|
||||
- `backend/app/rcon_historical_leaderboards.py`
|
||||
- `backend/app/rcon_annual_rankings.py`
|
||||
- `backend/app/routes.py`
|
||||
- `backend/app/payloads.py`
|
||||
- `ai/tasks/done/TASK-183-review-global-ranking-implementation.md`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- `docs/global-ranking-page-plan.md`
|
||||
- `ai/tasks/done/TASK-184-define-ranking-metric-expansion-contract.md`
|
||||
|
||||
## Constraints
|
||||
|
||||
- Documentation-only task.
|
||||
- Do not modify backend files.
|
||||
- Do not modify frontend files.
|
||||
- Do not create migrations.
|
||||
- Do not change scripts.
|
||||
- Do not reactivate Elo/MMR.
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not define public scoreboard as the normal primary source while RCON is available.
|
||||
- Do not expand annual behavior into runtime full-year recalculation on public requests.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task ensure:
|
||||
|
||||
- `docs/global-ranking-page-plan.md` explicitly documents V1.1 supported Ranking metrics
|
||||
- the contract defines formulas for:
|
||||
- `kills`
|
||||
- `deaths`
|
||||
- `teamkills`
|
||||
- `matches_considered`
|
||||
- `kd_ratio`
|
||||
- `kills_per_match`
|
||||
- the contract defines safe handling for:
|
||||
- `deaths=0`
|
||||
- `matches_considered=0`
|
||||
- the contract defines expected ordering for each metric
|
||||
- the contract defines timeframe support per metric and annual limitations explicitly
|
||||
- unsupported-metric error behavior is documented
|
||||
- non-goals remain explicit:
|
||||
- Elo/MMR
|
||||
- public scoreboard as primary source
|
||||
- large new tables
|
||||
- advanced charts
|
||||
- authentication
|
||||
- Comunidad Hispana #03
|
||||
- `git diff --name-only` stays within task scope
|
||||
- if automated tests do not apply because the task is documentation-only, that limitation is documented in the task outcome
|
||||
|
||||
## Outcome
|
||||
|
||||
Supported Ranking V1.1 metrics documented in `docs/global-ranking-page-plan.md`:
|
||||
|
||||
- `kills`
|
||||
- `deaths`
|
||||
- `teamkills`
|
||||
- `matches_considered`
|
||||
- `kd_ratio`
|
||||
- `kills_per_match`
|
||||
|
||||
Formula and aggregation rules documented:
|
||||
|
||||
- `kills = SUM(kills)`
|
||||
- `deaths = SUM(deaths)`
|
||||
- `teamkills = SUM(teamkills)`
|
||||
- `matches_considered = COUNT(DISTINCT match_key)`
|
||||
- `kd_ratio = SUM(kills) / SUM(deaths)`
|
||||
- `kills_per_match = SUM(kills) / COUNT(DISTINCT match_key)`
|
||||
|
||||
Safety rules documented:
|
||||
|
||||
- `deaths=0` returns finite display-safe `kd_ratio` using kills as the fallback value
|
||||
- `matches_considered=0` returns `kills_per_match = 0`
|
||||
|
||||
Ordering and tie-break expectations documented:
|
||||
|
||||
- totals metrics sort by active metric desc, then stable tie-break fields
|
||||
- `matches_considered` ties break on `kills` desc, then `player_name` asc
|
||||
- ratio metrics tie-break on `kills` desc, `matches_considered` desc, `player_name` asc
|
||||
|
||||
Supported timeframes by metric documented:
|
||||
|
||||
- weekly: all V1.1 metrics through the materialized RCON runtime leaderboard
|
||||
- monthly: all V1.1 metrics through the materialized RCON runtime leaderboard
|
||||
- annual: snapshot-safe path only; `kills` required, extra metrics only if an explicit snapshot-backed read path exists
|
||||
|
||||
Annual snapshot limitations and safety rules documented:
|
||||
|
||||
- no runtime annual recomputation on public requests
|
||||
- unsupported annual metrics must return controlled `400`
|
||||
- until extra annual snapshots exist, annual remains effectively `kills`-only
|
||||
|
||||
Expected payload adjustments documented:
|
||||
|
||||
- `metric_value` remains the active display/sort field
|
||||
- weekly/monthly payloads may include rounded ratio fields and `kills_per_match`
|
||||
- annual payload shape remains stable and only expands when snapshot-backed safely
|
||||
|
||||
Controlled error behavior documented:
|
||||
|
||||
- unsupported metric, unsupported timeframe and unsupported annual metric must fail with controlled request-validation errors
|
||||
- backend must not silently downgrade unsupported requests to `kills`
|
||||
|
||||
Validation performed:
|
||||
|
||||
- reviewed `docs/global-ranking-page-plan.md`
|
||||
- reviewed `docs/stats-section-functional-plan.md`
|
||||
- reviewed `docs/annual-ranking-snapshot-runbook.md`
|
||||
- reviewed `backend/app/rcon_historical_leaderboards.py`
|
||||
- reviewed `backend/app/rcon_annual_rankings.py`
|
||||
- reviewed `backend/app/routes.py`
|
||||
- reviewed `backend/app/payloads.py`
|
||||
- reviewed `ai/tasks/done/TASK-183-review-global-ranking-implementation.md`
|
||||
- confirmed `git diff --name-only` scope stays documentation-only for this task
|
||||
|
||||
Automated tests:
|
||||
|
||||
- No automated tests apply because this task remained documentation-only.
|
||||
|
||||
## 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.
|
||||
@@ -0,0 +1,179 @@
|
||||
---
|
||||
id: TASK-185-add-ranking-extra-metrics-backend-support
|
||||
title: Add ranking extra metrics backend support
|
||||
status: done
|
||||
type: backend
|
||||
team: Backend Senior
|
||||
supporting_teams:
|
||||
- Arquitecto Python
|
||||
- Arquitecto de Base de Datos
|
||||
roadmap_item: foundation
|
||||
priority: high
|
||||
---
|
||||
|
||||
# TASK-185-add-ranking-extra-metrics-backend-support - Add ranking extra metrics backend support
|
||||
|
||||
## Goal
|
||||
|
||||
Add backend support for additional `Ranking global` metrics by reusing the existing RCON materialized read model, while preserving the current Ranking route and avoiding unsafe annual recomputation.
|
||||
|
||||
## Context
|
||||
|
||||
`TASK-183` confirmed that `GET /api/ranking` currently supports only `metric=kills`, with weekly/monthly reading from the RCON materialized leaderboard and annual reading from snapshots. The next backend step is to extend metric support safely for weekly/monthly and keep annual constrained to snapshot-safe behavior only.
|
||||
|
||||
Preserve the current product identity: Spanish-speaking HLL Vietnam community, military/Vietnam/tactical/sober visual direction and controlled repository evolution.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Read the listed files first.
|
||||
2. Keep the public endpoint as:
|
||||
- `GET /api/ranking?timeframe=weekly|monthly|annual&server_id=<server-or-all>&metric=<metric>&limit=<limit>&year=<year>`
|
||||
3. Extend weekly/monthly support for:
|
||||
- `kills`
|
||||
- `deaths`
|
||||
- `teamkills`
|
||||
- `matches_considered`
|
||||
- `kd_ratio`
|
||||
- `kills_per_match`
|
||||
4. Preserve `metric=kills` behavior and compatibility for existing Ranking requests.
|
||||
5. Reuse the materialized RCON read model and avoid introducing a new ranking architecture.
|
||||
6. Keep annual support safe:
|
||||
- support `kills`
|
||||
- only support additional annual metrics if they are snapshot-backed without public full-year recomputation
|
||||
- otherwise return a controlled `400` for unsupported annual metrics
|
||||
7. Update route validation and payload normalization only where necessary.
|
||||
8. Extend validation coverage for the new metrics and failure cases.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `AGENTS.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/architecture-index.md`
|
||||
- `docs/global-ranking-page-plan.md`
|
||||
- `backend/app/routes.py`
|
||||
- `backend/app/payloads.py`
|
||||
- `backend/app/rcon_historical_leaderboards.py`
|
||||
- `backend/app/rcon_annual_rankings.py`
|
||||
- `scripts/run-stats-validation.ps1`
|
||||
- `scripts/run-integration-tests.ps1`
|
||||
- `ai/tasks/done/TASK-183-review-global-ranking-implementation.md`
|
||||
- `ai/tasks/done/TASK-184-define-ranking-metric-expansion-contract.md`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- `backend/app/rcon_historical_leaderboards.py`
|
||||
- `backend/app/routes.py`
|
||||
- `backend/app/payloads.py`
|
||||
- `backend/app/rcon_annual_rankings.py`
|
||||
- `scripts/run-stats-validation.ps1`
|
||||
- `ai/tasks/done/TASK-185-add-ranking-extra-metrics-backend-support.md`
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not create migrations.
|
||||
- Do not introduce a new architecture.
|
||||
- Do not recalculate the annual full-year ranking on public requests.
|
||||
- Do not reactivate Elo/MMR.
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not use public scoreboard as the normal primary source.
|
||||
- Do not modify frontend files.
|
||||
- Do not break Stats endpoints.
|
||||
- Do not break the existing Ranking route for `metric=kills`.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task ensure:
|
||||
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-stats-validation.ps1`
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- validate `GET /api/ranking` for:
|
||||
- `timeframe=weekly&metric=kills`
|
||||
- `timeframe=weekly&metric=deaths`
|
||||
- `timeframe=weekly&metric=teamkills`
|
||||
- `timeframe=weekly&metric=matches_considered`
|
||||
- `timeframe=weekly&metric=kd_ratio`
|
||||
- `timeframe=weekly&metric=kills_per_match`
|
||||
- `timeframe=monthly&metric=kd_ratio`
|
||||
- `timeframe=monthly&metric=kills_per_match`
|
||||
- `timeframe=annual&metric=kills`
|
||||
- unsupported metric
|
||||
- unsupported timeframe
|
||||
- `limit=3`
|
||||
- `limit=101` or invalid limit according to the current contract
|
||||
- confirm annual behavior is still snapshot-safe
|
||||
- confirm `git diff --name-only` stays within scope
|
||||
|
||||
## Outcome
|
||||
|
||||
Metrics added for `GET /api/ranking` weekly/monthly reads:
|
||||
|
||||
- `kills`
|
||||
- `deaths`
|
||||
- `teamkills`
|
||||
- `matches_considered`
|
||||
- `kd_ratio`
|
||||
- `kills_per_match`
|
||||
|
||||
Backend formulas and ordering applied:
|
||||
|
||||
- `kills = SUM(kills)` ordered by `kills` desc, `matches_considered` desc, `player_name` asc
|
||||
- `deaths = SUM(deaths)` ordered by `deaths` desc, `matches_considered` desc, `player_name` asc
|
||||
- `teamkills = SUM(teamkills)` ordered by `teamkills` desc, `matches_considered` desc, `player_name` asc
|
||||
- `matches_considered = COUNT(DISTINCT match_key)` ordered by `matches_considered` desc, `kills` desc, `player_name` asc
|
||||
- `kd_ratio = SUM(kills) / SUM(deaths)` with `deaths=0 -> kills`, ordered by `kd_ratio` desc, `kills` desc, `matches_considered` desc, `player_name` asc
|
||||
- `kills_per_match = SUM(kills) / COUNT(DISTINCT match_key)` with `matches_considered=0 -> 0`, ordered by `kills_per_match` desc, `kills` desc, `matches_considered` desc, `player_name` asc
|
||||
|
||||
Implementation summary:
|
||||
|
||||
- `backend/app/rcon_historical_leaderboards.py` now supports the V1.1 ranking metrics while preserving the existing materialized RCON read model.
|
||||
- `backend/app/routes.py` now validates the expanded public Ranking metric set without changing the endpoint shape.
|
||||
- `backend/app/payloads.py` now preserves decimal `metric_value` when needed and exposes `kills_per_match` in normalized ranking items.
|
||||
- `backend/app/rcon_annual_rankings.py` remains snapshot-safe and returns a controlled annual-specific `400` for unsupported annual metrics.
|
||||
- `scripts/run-stats-validation.ps1` now covers the new happy paths and annual guardrail failures.
|
||||
|
||||
Annual metric behavior and limitations:
|
||||
|
||||
- annual remains snapshot-backed only
|
||||
- `metric=kills` remains supported
|
||||
- extra annual metrics currently return controlled `400`
|
||||
- no runtime full-year recomputation was introduced
|
||||
|
||||
Validations executed:
|
||||
|
||||
- `python -m compileall backend/app/routes.py backend/app/payloads.py backend/app/rcon_historical_leaderboards.py backend/app/rcon_annual_rankings.py`
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-stats-validation.ps1`
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
|
||||
Validation notes:
|
||||
|
||||
- live backend HTTP validation at `http://127.0.0.1:8000` was not available during execution
|
||||
- route-contract validation still passed through local Python imports
|
||||
|
||||
Scope notes:
|
||||
|
||||
- task-owned modifications stayed within:
|
||||
- `backend/app/rcon_historical_leaderboards.py`
|
||||
- `backend/app/routes.py`
|
||||
- `backend/app/payloads.py`
|
||||
- `backend/app/rcon_annual_rankings.py`
|
||||
- `scripts/run-stats-validation.ps1`
|
||||
- `git diff --name-only` also showed pre-existing or previous-task changes outside this task:
|
||||
- moved task files from `TASK-184` / `TASK-185`
|
||||
- `docs/global-ranking-page-plan.md` from `TASK-184`
|
||||
- unrelated existing workspace change `frontend/assets/img/weapons/black/gewehr_black.svg`
|
||||
- those files were not modified as part of this backend task.
|
||||
|
||||
Known limitations:
|
||||
|
||||
- annual extra metrics are intentionally blocked until an explicit snapshot-backed implementation exists
|
||||
- ranking item decimals are validated through route-contract checks, not through a running backend HTTP instance in this run
|
||||
|
||||
Recommended next task:
|
||||
|
||||
- expose the new metrics safely in the Ranking frontend UX.
|
||||
|
||||
## 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.
|
||||
191
ai/tasks/done/TASK-186-polish-ranking-metric-ux-and-limits.md
Normal file
191
ai/tasks/done/TASK-186-polish-ranking-metric-ux-and-limits.md
Normal file
@@ -0,0 +1,191 @@
|
||||
---
|
||||
id: TASK-186-polish-ranking-metric-ux-and-limits
|
||||
title: Polish ranking metric UX and limits
|
||||
status: done
|
||||
type: frontend
|
||||
team: Frontend Senior
|
||||
supporting_teams:
|
||||
- Experto en interfaz
|
||||
- Disenador grafico
|
||||
- Backend Senior
|
||||
roadmap_item: foundation
|
||||
priority: high
|
||||
---
|
||||
|
||||
# TASK-186-polish-ranking-metric-ux-and-limits - Polish ranking metric UX and limits
|
||||
|
||||
## Goal
|
||||
|
||||
Update the `Ranking` page UX so it exposes the backend-supported metric set clearly, improves limit handling and error messaging, and preserves the separation between global tops and player-specific Stats.
|
||||
|
||||
## Context
|
||||
|
||||
The current Ranking UI is limited to `kills`, only exposes a small set of limits, and handles invalid `limit` through a generic error path. If backend metric expansion is delivered, the frontend must expose the new metric set safely, keep annual constraints clear, and improve the explanatory UX without changing backend architecture.
|
||||
|
||||
Preserve the current product identity: Spanish-speaking HLL Vietnam community, military/Vietnam/tactical/sober visual direction and controlled repository evolution.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Read the listed files first.
|
||||
2. Update `ranking.html`, `ranking.js` and styling only as needed to expose the supported Ranking metric set.
|
||||
3. Allow selecting:
|
||||
- `kills`
|
||||
- `deaths`
|
||||
- `teamkills`
|
||||
- `matches_considered`
|
||||
- `kd_ratio`
|
||||
- `kills_per_match`
|
||||
4. Make the UI clearly show:
|
||||
- the active metric
|
||||
- the active timeframe
|
||||
- the active server
|
||||
5. If annual remains `kills`-only, hide, disable or clearly message unsupported annual metrics without breaking the flow.
|
||||
6. Improve limit UX so the available UI limits are reasonable and aligned with backend constraints.
|
||||
7. Add a clearer message for invalid `limit` if it arrives from manual URL or parameter manipulation.
|
||||
8. Keep or improve the message for unsupported metric and unsupported timeframe.
|
||||
9. Preserve the guidance that `Stats` is for one-player lookup and `Ranking` is for global tops.
|
||||
10. Add only minimal cross-linking between `Ranking` and `Stats` if helpful and already aligned with existing page patterns.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `AGENTS.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/architecture-index.md`
|
||||
- `docs/global-ranking-page-plan.md`
|
||||
- `frontend/ranking.html`
|
||||
- `frontend/assets/js/ranking.js`
|
||||
- `frontend/assets/css/styles.css`
|
||||
- `frontend/stats.html`
|
||||
- `frontend/assets/js/stats.js`
|
||||
- `backend/app/routes.py`
|
||||
- `ai/tasks/done/TASK-185-add-ranking-extra-metrics-backend-support.md`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- `frontend/ranking.html`
|
||||
- `frontend/assets/js/ranking.js`
|
||||
- `frontend/assets/css/styles.css`
|
||||
- `frontend/stats.html`
|
||||
- `scripts/run-stats-validation.ps1`
|
||||
- `ai/tasks/done/TASK-186-polish-ranking-metric-ux-and-limits.md`
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not modify backend files.
|
||||
- Do not create endpoints.
|
||||
- Do not modify the database.
|
||||
- Do not reactivate Elo/MMR.
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not introduce frameworks.
|
||||
- Keep HTML/CSS/JS vanilla.
|
||||
- Maintain the military/Vietnam/tactical/sober visual identity.
|
||||
- Do not break Stats.
|
||||
- Do not duplicate complex logic unnecessarily.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task ensure:
|
||||
|
||||
- `node --check frontend/assets/js/ranking.js`
|
||||
- `node --check frontend/assets/js/stats.js`
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-stats-validation.ps1`
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- serve frontend with `python -m http.server` and confirm HTTP `200` for:
|
||||
- `ranking.html`
|
||||
- `assets/js/ranking.js`
|
||||
- `stats.html`
|
||||
- `index.html`
|
||||
- if local backend is available, validate real metric selection against the supported backend contract
|
||||
- if backend is unavailable, validate the offline fallback path explicitly
|
||||
- confirm `git diff --name-only` stays within scope
|
||||
|
||||
## Outcome
|
||||
|
||||
Metrics exposed in Ranking UI:
|
||||
|
||||
- `kills`
|
||||
- `deaths`
|
||||
- `teamkills`
|
||||
- `matches_considered`
|
||||
- `kd_ratio`
|
||||
- `kills_per_match`
|
||||
|
||||
Frontend UX changes delivered:
|
||||
|
||||
- `frontend/ranking.html` now exposes the expanded metric selector and wider limit options.
|
||||
- the ranking table now highlights the active metric dynamically while still showing the core supporting stats (`kills`, `deaths`, `teamkills`, `matches_considered`, `kd_ratio`, `kills_per_match`)
|
||||
- the metadata strip now shows the active timeframe, active server, active metric, limit, window and source more explicitly
|
||||
- `frontend/assets/js/ranking.js` now restores filter state from URL parameters and keeps the URL synced as filters change
|
||||
- `frontend/stats.html` now includes a minimal direct link back to `Ranking`
|
||||
|
||||
Annual behavior in the UX:
|
||||
|
||||
- annual keeps `kills` as the only selectable active metric
|
||||
- when the user switches to annual, non-snapshot-safe metrics are disabled in the selector
|
||||
- the page shows an explicit note that annual remains `kills`-only until additional safe snapshots exist
|
||||
- annual unsupported-metric and missing-snapshot states remain clearly differentiated
|
||||
|
||||
UI limit choices:
|
||||
|
||||
- `Top 5`
|
||||
- `Top 10`
|
||||
- `Top 20`
|
||||
- `Top 50`
|
||||
- `Top 100`
|
||||
|
||||
Error and state coverage improved:
|
||||
|
||||
- dedicated invalid-limit message for manual URL or parameter manipulation
|
||||
- dedicated annual kills-only warning
|
||||
- preserved unsupported metric message
|
||||
- preserved unsupported timeframe message
|
||||
- preserved backend offline fallback path
|
||||
- preserved annual snapshot missing state
|
||||
- preserved empty-ready states
|
||||
|
||||
Validation updates:
|
||||
|
||||
- `scripts/run-stats-validation.ps1` now asserts the new Ranking metric options, annual kills-only guidance, URL-state handling and the Stats-to-Ranking link
|
||||
|
||||
Validations executed:
|
||||
|
||||
- `node --check frontend/assets/js/ranking.js`
|
||||
- `node --check frontend/assets/js/stats.js`
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-stats-validation.ps1`
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- temporary static serving with `python -m http.server 8081`
|
||||
- confirmed HTTP `200` for:
|
||||
- `ranking.html`
|
||||
- `assets/js/ranking.js`
|
||||
- `stats.html`
|
||||
- `index.html`
|
||||
|
||||
Validation notes:
|
||||
|
||||
- local backend HTTP validation at `http://127.0.0.1:8000` was unavailable during the run
|
||||
- offline fallback behavior was therefore validated through the existing frontend logic plus route-contract checks from the shared validation script
|
||||
|
||||
Scope notes:
|
||||
|
||||
- task-owned frontend changes stayed within:
|
||||
- `frontend/ranking.html`
|
||||
- `frontend/assets/js/ranking.js`
|
||||
- `frontend/assets/css/styles.css`
|
||||
- `frontend/stats.html`
|
||||
- `scripts/run-stats-validation.ps1`
|
||||
- `git diff --name-only` also shows previous-task backend/docs changes and an unrelated existing workspace change:
|
||||
- moved task files from `TASK-184` / `TASK-185` / `TASK-186`
|
||||
- `backend/app/*` and `docs/global-ranking-page-plan.md` from prior tasks in this run
|
||||
- `frontend/assets/img/weapons/black/gewehr_black.svg`
|
||||
- those files were not modified as part of this frontend task.
|
||||
|
||||
Recommended follow-ups:
|
||||
|
||||
- if a live backend session becomes available, run an explicit browser-side validation pass for every supported metric against real responses
|
||||
- if annual extra metrics are introduced later, keep the current UX branch but switch from disabled options to active snapshot-backed support only when backend snapshots exist.
|
||||
|
||||
## 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.
|
||||
Reference in New Issue
Block a user