feat: resolve scoreboard links and enrich match details
Implement trusted scoreboard origins, persisted scoreboard links, RCON-to-scoreboard correlation, match link UX priority, enriched internal match details, and historical UI regression validation.
This commit is contained in:
151
ai/tasks/done/TASK-114-centralize-scoreboard-origin-catalog.md
Normal file
151
ai/tasks/done/TASK-114-centralize-scoreboard-origin-catalog.md
Normal file
@@ -0,0 +1,151 @@
|
||||
---
|
||||
id: TASK-114
|
||||
title: Centralize scoreboard origin catalog
|
||||
status: done
|
||||
type: backend
|
||||
team: Backend Senior
|
||||
supporting_teams:
|
||||
- Arquitecto Python
|
||||
- PM
|
||||
roadmap_item: historical
|
||||
priority: high
|
||||
---
|
||||
|
||||
# TASK-114 - Centralize scoreboard origin catalog
|
||||
|
||||
## Goal
|
||||
|
||||
Create a single safe source of truth for trusted public scoreboard origins per active server.
|
||||
|
||||
## Context
|
||||
|
||||
Recent match cards can now fall back to internal details for RCON synthetic matches. The next step is to make trusted external scoreboard origin handling explicit and reusable so future link resolution remains safe.
|
||||
|
||||
Required origin behavior:
|
||||
|
||||
- Comunidad Hispana #01 must use the configured base scoreboard origin for #01, without a custom port.
|
||||
- Comunidad Hispana #02 must use the same scoreboard host with port `5443`.
|
||||
- Comunidad Hispana #03 must not be included in public/default origin flows.
|
||||
|
||||
Use branch:
|
||||
|
||||
- `plan/scoreboard-match-linking-tasks`
|
||||
|
||||
## Steps
|
||||
|
||||
1. Work from this task only after moving it to `ai/tasks/in-progress/`.
|
||||
2. Inspect the listed files before changing anything.
|
||||
3. Inspect historical storage, RCON historical read/storage modules, config, env example, Docker Compose and relevant docs.
|
||||
4. Centralize trusted scoreboard origins in a backend helper/config location.
|
||||
5. Ensure URL validation accepts the trusted origins for #01 and #02, including the #02 `5443` port.
|
||||
6. Ensure Comunidad Hispana #03 is not part of the trusted scoreboard origin catalog.
|
||||
7. Keep existing safe `raw_payload_ref` behavior intact.
|
||||
8. Update or add a concise docs decision if this creates or clarifies a backend contract.
|
||||
9. Validate the result.
|
||||
10. Move this task to `ai/tasks/done/` only after validation is complete and document the outcome in this file.
|
||||
11. Commit and push the completed implementation branch.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `ai/architecture-index.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/orchestrator/backend-senior.md`
|
||||
- `backend/app/config.py`
|
||||
- `backend/app/historical_storage.py`
|
||||
- `backend/app/rcon_historical_read_model.py`
|
||||
- `backend/app/rcon_historical_storage.py`
|
||||
- `backend/app/payloads.py`
|
||||
- `backend/app/providers/public_scoreboard_provider.py`
|
||||
- `backend/.env.example`
|
||||
- `docker-compose.yml`
|
||||
- `docs/decisions.md`
|
||||
- `scripts/run-integration-tests.ps1`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- likely one backend helper/config module for trusted scoreboard origins
|
||||
- possibly `backend/app/config.py`
|
||||
- possibly `backend/app/payloads.py`
|
||||
- possibly `backend/app/historical_storage.py`
|
||||
- possibly tests under `backend/tests/`
|
||||
- possibly `docs/decisions.md`
|
||||
- this task file, moved to `ai/tasks/done/`
|
||||
|
||||
If additional files become necessary, explain why in the task outcome and commit message.
|
||||
|
||||
## Expected Files Not to Modify
|
||||
|
||||
- `frontend/**`
|
||||
- local `.env`
|
||||
- database migrations
|
||||
- persisted data
|
||||
- Elo/MMR implementation files
|
||||
- unrelated backend modules
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not reintroduce paused MVP/Elo UI.
|
||||
- Do not change historical ingestion policy.
|
||||
- Do not add real credentials.
|
||||
- Do not modify local `.env`.
|
||||
- Do not delete persisted data, migrations, backend endpoints or historical ingestion code.
|
||||
- Do not use the public word "snapshot" in user-facing UI.
|
||||
- Keep the change focused on trusted scoreboard origin configuration and validation.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task, run and document:
|
||||
|
||||
- `git status`
|
||||
- Python compile checks for touched backend modules, for example `python -m compileall backend/app`
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- focused check confirming #01 and #02 trusted origins exist
|
||||
- focused check confirming Comunidad Hispana #03 is absent from trusted public/default origins
|
||||
- focused check confirming #02 preserves port `5443`
|
||||
- focused check confirming existing safe `raw_payload_ref` behavior still works
|
||||
- `git diff --name-only` and confirmation that changed files match the expected scope
|
||||
|
||||
If a configured validation command cannot be run, document the exact reason in the outcome.
|
||||
|
||||
## Commit And Push Requirements
|
||||
|
||||
- Run validation before committing.
|
||||
- Run `git status`.
|
||||
- Stage only intended files.
|
||||
- Commit with message: `chore: centralize scoreboard origin catalog`
|
||||
- Push the branch to origin.
|
||||
- Do not leave completed work only in local.
|
||||
|
||||
## Outcome
|
||||
|
||||
Completed.
|
||||
|
||||
Implementation decisions:
|
||||
|
||||
- Added `backend/app/scoreboard_origins.py` as the single trusted public scoreboard origin catalog for active default servers.
|
||||
- Kept only `comunidad-hispana-01` and `comunidad-hispana-02` in the trusted catalog; #02 preserves port `5443`.
|
||||
- Derived `DEFAULT_HISTORICAL_SERVERS` from the trusted catalog so new default seeds do not reintroduce `comunidad-hispana-03`.
|
||||
- Routed safe match URL resolution through the trusted catalog instead of trusting each persisted `scoreboard_base_url` row. Existing persisted data is not deleted.
|
||||
- Updated `docs/decisions.md` with the backend contract for trusted active public scoreboard origins.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `git status --short --branch` confirmed branch `plan/scoreboard-match-linking-tasks`.
|
||||
- `python -m compileall backend/app` passed.
|
||||
- Focused Python check confirmed #01 and #02 trusted origins exist.
|
||||
- Focused Python check confirmed `comunidad-hispana-03` is absent from trusted public/default origins.
|
||||
- Focused Python check confirmed #02 preserves port `5443`.
|
||||
- Focused Python check confirmed safe `raw_payload_ref` behavior still accepts trusted `/games/` URLs and rejects #03, non-`/games/` paths and credentialed URLs.
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1` passed.
|
||||
- `git diff --name-only` / `git status --short` reviewed. Changed files match the expected scope plus the new backend helper module and this task file.
|
||||
|
||||
Follow-up:
|
||||
|
||||
- Continue with TASK-115 for persisted scoreboard link resolution behavior instead of expanding this task.
|
||||
|
||||
## Change Budget
|
||||
|
||||
- Prefer fewer than 5 modified files.
|
||||
- Prefer changes under 200 lines when feasible.
|
||||
- Split follow-up work into a new task if the scope grows.
|
||||
141
ai/tasks/done/TASK-115-resolve-persisted-scoreboard-links.md
Normal file
141
ai/tasks/done/TASK-115-resolve-persisted-scoreboard-links.md
Normal file
@@ -0,0 +1,141 @@
|
||||
---
|
||||
id: TASK-115
|
||||
title: Resolve persisted scoreboard links
|
||||
status: done
|
||||
type: backend
|
||||
team: Backend Senior
|
||||
supporting_teams:
|
||||
- Frontend Senior
|
||||
- PM
|
||||
roadmap_item: historical
|
||||
priority: high
|
||||
---
|
||||
|
||||
# TASK-115 - Resolve persisted scoreboard links
|
||||
|
||||
## Goal
|
||||
|
||||
Make sure all existing persisted public-scoreboard matches expose a safe `match_url` consistently.
|
||||
|
||||
## Context
|
||||
|
||||
The UI should prefer safe external scoreboard links when the match is already a persisted public-scoreboard match. This task is limited to persisted scoreboard data and must not use RCON synthetic IDs to construct external URLs.
|
||||
|
||||
Use branch:
|
||||
|
||||
- `plan/scoreboard-match-linking-tasks`
|
||||
|
||||
## Steps
|
||||
|
||||
1. Work from this task only after moving it to `ai/tasks/in-progress/`.
|
||||
2. Inspect the listed files before changing anything.
|
||||
3. Inspect historical storage detail and recent match payloads.
|
||||
4. Ensure recent match list responses return `match_url` when `raw_payload_ref` exists and passes trusted origin validation.
|
||||
5. Ensure the match detail endpoint returns `match_url` for persisted scoreboard matches when `raw_payload_ref` exists and passes trusted origin validation.
|
||||
6. Do not use RCON synthetic IDs for this task.
|
||||
7. Do not fabricate external URLs when no trusted persisted URL exists.
|
||||
8. Add tests or focused checks if feasible in the current repo.
|
||||
9. Validate the result.
|
||||
10. Move this task to `ai/tasks/done/` only after validation is complete and document the outcome in this file.
|
||||
11. Commit and push the completed implementation branch.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `ai/architecture-index.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/orchestrator/backend-senior.md`
|
||||
- `backend/app/historical_storage.py`
|
||||
- `backend/app/historical_snapshots.py`
|
||||
- `backend/app/payloads.py`
|
||||
- `backend/app/routes.py`
|
||||
- backend trusted scoreboard origin helper/config from TASK-114
|
||||
- `backend/tests/` if present
|
||||
- `scripts/run-integration-tests.ps1`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- `backend/app/historical_storage.py`
|
||||
- possibly `backend/app/historical_snapshots.py`
|
||||
- possibly `backend/app/payloads.py`
|
||||
- possibly `backend/app/routes.py`
|
||||
- possibly backend tests
|
||||
- this task file, moved to `ai/tasks/done/`
|
||||
|
||||
If additional files become necessary, explain why in the task outcome and commit message.
|
||||
|
||||
## Expected Files Not to Modify
|
||||
|
||||
- `frontend/**`
|
||||
- local `.env`
|
||||
- database migrations
|
||||
- persisted data
|
||||
- Docker/Compose config
|
||||
- Elo/MMR implementation files
|
||||
- historical ingestion policy/config
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not reintroduce paused MVP/Elo UI.
|
||||
- Do not change historical ingestion policy.
|
||||
- Do not add real credentials.
|
||||
- Do not modify local `.env`.
|
||||
- Do not delete persisted data, migrations, backend endpoints or historical ingestion code.
|
||||
- Do not use the public word "snapshot" in user-facing UI.
|
||||
- Keep the change limited to safe `match_url` exposure for persisted public-scoreboard matches.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task, run and document:
|
||||
|
||||
- `git status`
|
||||
- Python compile checks for touched backend modules
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- recent matches endpoint check confirming persisted scoreboard matches expose safe `match_url` when available
|
||||
- match detail endpoint check for a persisted scoreboard match if fixture/data exists
|
||||
- focused check confirming unsafe or untrusted URLs are not accepted
|
||||
- focused check confirming RCON synthetic IDs are not used to construct external URLs
|
||||
- `git diff --name-only` and confirmation that changed files match the expected scope
|
||||
|
||||
If a configured validation command cannot be run, document the exact reason in the outcome.
|
||||
|
||||
## Commit And Push Requirements
|
||||
|
||||
- Run validation before committing.
|
||||
- Run `git status`.
|
||||
- Stage only intended files.
|
||||
- Commit with message: `fix: resolve persisted scoreboard match links`
|
||||
- Push the branch to origin.
|
||||
- Do not leave completed work only in local.
|
||||
|
||||
## Outcome
|
||||
|
||||
Completed.
|
||||
|
||||
Implementation decisions:
|
||||
|
||||
- No additional production-code change was needed in this task because TASK-114 already routed recent-match and detail `match_url` resolution through the trusted scoreboard origin catalog.
|
||||
- Added `backend/tests/test_scoreboard_match_links.py` as a focused stdlib `unittest` regression check for persisted public-scoreboard match links.
|
||||
- The test verifies recent-match and match-detail payloads expose safe persisted URLs, rejects an untrusted #03 origin, and confirms RCON synthetic match IDs are not used to fabricate external scoreboard URLs.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `git status --short --branch` confirmed branch `plan/scoreboard-match-linking-tasks`.
|
||||
- `$env:PYTHONPATH='backend'; python -m unittest backend.tests.test_scoreboard_match_links` passed.
|
||||
- `python -m compileall backend/app backend/tests` passed.
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1` passed.
|
||||
- Recent matches endpoint behavior was covered by the regression test through `list_recent_historical_matches`.
|
||||
- Match detail endpoint behavior was covered by the regression test through `get_historical_match_detail`.
|
||||
- Unsafe/untrusted URL rejection was covered with a persisted #03-origin `raw_payload_ref`.
|
||||
- RCON synthetic ID non-fabrication was covered with `get_rcon_historical_match_detail`.
|
||||
- `git diff --name-only` and `git status --short` were reviewed. Changed files match the expected scope: backend test coverage plus this task file.
|
||||
|
||||
Note:
|
||||
|
||||
- The focused unittest emits existing SQLite `ResourceWarning` messages from the repository connection helper pattern during forced cleanup, but all assertions pass and no temp database remains locked.
|
||||
|
||||
## Change Budget
|
||||
|
||||
- Prefer fewer than 5 modified files.
|
||||
- Prefer changes under 200 lines when feasible.
|
||||
- Split follow-up work into a new task if the scope grows.
|
||||
@@ -0,0 +1,173 @@
|
||||
---
|
||||
id: TASK-116
|
||||
title: Correlate RCON windows with scoreboard matches
|
||||
status: done
|
||||
type: backend
|
||||
team: Backend Senior
|
||||
supporting_teams:
|
||||
- Arquitecto Python
|
||||
- Analista
|
||||
- PM
|
||||
roadmap_item: historical
|
||||
priority: high
|
||||
---
|
||||
|
||||
# TASK-116 - Correlate RCON windows with scoreboard matches
|
||||
|
||||
## Goal
|
||||
|
||||
Resolve external scoreboard URLs for RCON competitive-window synthetic matches only when there is strong evidence.
|
||||
|
||||
## Context
|
||||
|
||||
RCON competitive-window matches can have synthetic IDs such as `31:2026-04-12T16:28:55.761810Z`. Those IDs must stay internal and must never be used to fabricate external scoreboard URLs.
|
||||
|
||||
Known validation reference from the user:
|
||||
|
||||
- Internal RCON match:
|
||||
- server: Comunidad Hispana #01
|
||||
- synthetic match id: `31:2026-04-12T16:28:55.761810Z`
|
||||
- map shown: St. Mere Eglise
|
||||
- UI start/end around 12/4/26 18:28 to 18:43 local time
|
||||
- players: 94 average / 98 peak
|
||||
- Equivalent real scoreboard game known by the user:
|
||||
- game id: `1561515`
|
||||
- external scoreboard page exists under the server #01 scoreboard origin
|
||||
|
||||
This task must use that example as a fixture/reference without hardcoding a one-off special case.
|
||||
|
||||
Use branch:
|
||||
|
||||
- `plan/scoreboard-match-linking-tasks`
|
||||
|
||||
## Steps
|
||||
|
||||
1. Work from this task only after moving it to `ai/tasks/in-progress/`.
|
||||
2. Inspect the listed files before changing anything.
|
||||
3. Build a resolver that takes server, synthetic session key, map, `started_at`, `ended_at`, duration and player counts.
|
||||
4. Search existing persisted scoreboard data first.
|
||||
5. If existing provider code can query recent scoreboard data without credentials, use it carefully; otherwise document the limitation and keep the resolver local-only.
|
||||
6. Match by server, normalized map and time proximity at minimum.
|
||||
7. Use additional evidence such as duration and player counts when available.
|
||||
8. Avoid false positives; return no URL when confidence is low.
|
||||
9. Return only URLs that pass trusted origin validation.
|
||||
10. Ensure the match detail endpoint exposes `match_url` for RCON matches only when resolver confidence is sufficient.
|
||||
11. Add a focused unit or fixture test for the correlation logic if feasible.
|
||||
12. Validate the result.
|
||||
13. Move this task to `ai/tasks/done/` only after validation is complete and document the outcome in this file.
|
||||
14. Commit and push the completed implementation branch.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `ai/architecture-index.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/orchestrator/backend-senior.md`
|
||||
- `ai/orchestrator/analyst.md`
|
||||
- `backend/app/rcon_historical_read_model.py`
|
||||
- `backend/app/rcon_historical_storage.py`
|
||||
- `backend/app/historical_storage.py`
|
||||
- `backend/app/historical_snapshots.py`
|
||||
- `backend/app/routes.py`
|
||||
- `backend/app/providers/public_scoreboard_provider.py`
|
||||
- backend trusted scoreboard origin helper/config from TASK-114
|
||||
- `backend/tests/` if present
|
||||
- `scripts/run-integration-tests.ps1`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- likely a new or existing backend resolver module
|
||||
- possibly `backend/app/rcon_historical_read_model.py`
|
||||
- possibly `backend/app/historical_storage.py`
|
||||
- possibly `backend/app/routes.py`
|
||||
- possibly backend tests or fixtures
|
||||
- this task file, moved to `ai/tasks/done/`
|
||||
|
||||
If additional files become necessary, explain why in the task outcome and commit message.
|
||||
|
||||
## Expected Files Not to Modify
|
||||
|
||||
- `frontend/**`
|
||||
- local `.env`
|
||||
- database migrations unless absolutely required and justified
|
||||
- persisted data
|
||||
- Docker/Compose config
|
||||
- Elo/MMR implementation files
|
||||
- historical ingestion policy/config
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not reintroduce paused MVP/Elo UI.
|
||||
- Do not change historical ingestion policy.
|
||||
- Do not add real credentials.
|
||||
- Do not modify local `.env`.
|
||||
- Do not delete persisted data, migrations, backend endpoints or historical ingestion code.
|
||||
- Do not use the public word "snapshot" in user-facing UI.
|
||||
- Do not fabricate unsafe URLs from synthetic RCON IDs.
|
||||
- Prefer no link over a low-confidence or ambiguous link.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task, run and document:
|
||||
|
||||
- `git status`
|
||||
- Python compile checks for touched backend modules
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- focused unit or fixture test for correlation logic if feasible
|
||||
- endpoint check confirming `match_url` appears only when confidence is sufficient
|
||||
- negative test/check confirming low-confidence or ambiguous candidates return no URL
|
||||
- check using the user reference example when data or fixture setup allows it
|
||||
- check confirming generated/exposed URLs pass trusted origin validation
|
||||
- `git diff --name-only` and confirmation that changed files match the expected scope
|
||||
|
||||
If a configured validation command cannot be run, document the exact reason in the outcome.
|
||||
|
||||
## Commit And Push Requirements
|
||||
|
||||
- Run validation before committing.
|
||||
- Run `git status`.
|
||||
- Stage only intended files.
|
||||
- Commit with message: `feat: correlate rcon matches with scoreboard links`
|
||||
- Push the branch to origin.
|
||||
- Do not leave completed work only in local.
|
||||
|
||||
## Outcome
|
||||
|
||||
Completed.
|
||||
|
||||
Implementation decisions:
|
||||
|
||||
- Added `backend/app/rcon_scoreboard_correlation.py` as a local-only resolver over already persisted public-scoreboard matches.
|
||||
- The resolver does not query the public provider or network during request handling. It searches persisted `historical_matches` first and returns no URL when no strong local match exists.
|
||||
- `backend/app/rcon_historical_read_model.py` now calls the resolver for RCON match-detail payloads and keeps the synthetic RCON session key internal.
|
||||
- No URL is built from a synthetic RCON ID. Returned URLs must come from persisted `raw_payload_ref` and pass the trusted origin validation from TASK-114.
|
||||
|
||||
Confidence rules chosen:
|
||||
|
||||
- Required evidence: same server, normalized map match, parseable RCON and scoreboard time windows, and a trusted persisted `raw_payload_ref`.
|
||||
- Scored evidence: time overlap, RCON midpoint inside the scoreboard match, endpoint proximity, duration compatibility, and optional player-count compatibility.
|
||||
- Minimum score: `5`.
|
||||
- Ambiguity handling: if two candidates tie for the best score, the resolver returns no URL.
|
||||
- Preference: no link over a low-confidence or ambiguous link.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `git status --short --branch` confirmed branch `plan/scoreboard-match-linking-tasks`.
|
||||
- `$env:PYTHONPATH='backend'; python -m unittest backend.tests.test_scoreboard_match_links` passed.
|
||||
- The focused test includes the user reference shape: `comunidad-hispana-01`, RCON synthetic session `1:2026-04-12T16:28:55.761810Z`, map `St. Mere Eglise`, and correlated scoreboard game `1561515`.
|
||||
- The focused test confirms `match_url` appears only with strong evidence.
|
||||
- The focused test confirms low-confidence/wrong-map candidates return no URL.
|
||||
- The focused tests confirm exposed URLs pass trusted origin validation because only persisted trusted `raw_payload_ref` values are returned.
|
||||
- `python -m compileall backend/app backend/tests` passed.
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1` passed.
|
||||
- `git diff --name-only` and `git status --short` were reviewed. Changed files match the expected scope: new resolver module, RCON read model integration, focused backend tests and this task file.
|
||||
|
||||
Note:
|
||||
|
||||
- The focused unittest still emits existing SQLite `ResourceWarning` messages from the repository connection helper pattern during forced cleanup, but all assertions pass and cleanup is not blocked.
|
||||
|
||||
## Change Budget
|
||||
|
||||
- Prefer fewer than 5 modified files.
|
||||
- Prefer changes under 200 lines when feasible.
|
||||
- Split follow-up work into a new task if the scope grows.
|
||||
150
ai/tasks/done/TASK-117-prioritize-match-link-ux.md
Normal file
150
ai/tasks/done/TASK-117-prioritize-match-link-ux.md
Normal file
@@ -0,0 +1,150 @@
|
||||
---
|
||||
id: TASK-117
|
||||
title: Prioritize match link UX
|
||||
status: done
|
||||
type: frontend
|
||||
team: Frontend Senior
|
||||
supporting_teams:
|
||||
- Experto en interfaz
|
||||
- Backend Senior
|
||||
roadmap_item: historical-ui
|
||||
priority: high
|
||||
---
|
||||
|
||||
# TASK-117 - Prioritize match link UX
|
||||
|
||||
## Goal
|
||||
|
||||
Adjust the historical UI link priority so safe external scoreboard links are primary when available, and internal details remain the fallback.
|
||||
|
||||
## Context
|
||||
|
||||
Recent cards currently show internal `Ver detalles` links when no safe external match URL exists. After persisted and correlated `match_url` support is improved, the UI must prefer safe external scoreboard links without making unsafe assumptions.
|
||||
|
||||
Use branch:
|
||||
|
||||
- `plan/scoreboard-match-linking-tasks`
|
||||
|
||||
## Steps
|
||||
|
||||
1. Work from this task only after moving it to `ai/tasks/in-progress/`.
|
||||
2. Inspect the listed files before changing anything.
|
||||
3. On recent match cards:
|
||||
- If safe external `match_url` exists, show primary `Ver partida`.
|
||||
- If no `match_url` exists, show internal `Ver detalles`.
|
||||
4. On the internal match detail page:
|
||||
- If `match_url` exists, show `Abrir en scoreboard`.
|
||||
- If no `match_url` exists, keep internal details only.
|
||||
5. Ensure external links use `target="_blank"` and `rel="noopener noreferrer"`.
|
||||
6. Do not show both buttons as competing primary actions unless the existing design clearly requires it.
|
||||
7. Preserve the current sober military/Vietnam tactical visual style.
|
||||
8. Validate the result.
|
||||
9. Move this task to `ai/tasks/done/` only after validation is complete and document the outcome in this file.
|
||||
10. Commit and push the completed implementation branch.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `ai/architecture-index.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/orchestrator/frontend-senior.md`
|
||||
- `ai/orchestrator/ui-expert.md`
|
||||
- `frontend/historico.html`
|
||||
- `frontend/assets/js/historico.js`
|
||||
- `frontend/assets/css/historico.css`
|
||||
- `frontend/historico-partida.html`
|
||||
- `frontend/assets/js/historico-partida.js`
|
||||
- `backend/app/routes.py`
|
||||
- `scripts/run-integration-tests.ps1`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- `frontend/assets/js/historico.js`
|
||||
- possibly `frontend/assets/css/historico.css`
|
||||
- possibly `frontend/historico-partida.html`
|
||||
- possibly `frontend/assets/js/historico-partida.js`
|
||||
- this task file, moved to `ai/tasks/done/`
|
||||
|
||||
If additional files become necessary, explain why in the task outcome and commit message.
|
||||
|
||||
## Expected Files Not to Modify
|
||||
|
||||
- backend historical ingestion modules
|
||||
- database migrations
|
||||
- persisted data
|
||||
- local `.env`
|
||||
- Docker/Compose config
|
||||
- Elo/MMR implementation files
|
||||
- unrelated frontend pages
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not reintroduce paused MVP/Elo UI.
|
||||
- Do not change historical ingestion policy.
|
||||
- Do not add real credentials.
|
||||
- Do not modify local `.env`.
|
||||
- Do not delete persisted data, migrations, backend endpoints or historical ingestion code.
|
||||
- Do not use the public word "snapshot" in user-facing UI.
|
||||
- Do not fabricate or transform external URLs in the frontend; trust only backend-provided `match_url`.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task, run and document:
|
||||
|
||||
- `git status`
|
||||
- `node --check frontend/assets/js/historico.js`
|
||||
- `node --check frontend/assets/js/historico-partida.js` if present
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- served or static HTML check confirming recent cards show `Ver partida` when `match_url` exists
|
||||
- served or static HTML check confirming recent cards show `Ver detalles` when `match_url` is absent
|
||||
- served or static HTML check confirming detail page shows `Abrir en scoreboard` when `match_url` exists
|
||||
- served or static HTML check confirming no Comunidad Hispana #03 appears
|
||||
- served or static HTML check confirming paused MVP/Elo UI remains absent
|
||||
- check confirming external links include `target="_blank"` and `rel="noopener noreferrer"`
|
||||
- `git diff --name-only` and confirmation that changed files match the expected scope
|
||||
|
||||
If a configured validation command cannot be run, document the exact reason in the outcome.
|
||||
|
||||
## Commit And Push Requirements
|
||||
|
||||
- Run validation before committing.
|
||||
- Run `git status`.
|
||||
- Stage only intended files.
|
||||
- Commit with message: `chore: prioritize match link ux`
|
||||
- Push the branch to origin.
|
||||
- Do not leave completed work only in local.
|
||||
|
||||
## Outcome
|
||||
|
||||
Completed.
|
||||
|
||||
Implementation decisions:
|
||||
|
||||
- Recent match cards now trust only backend-provided `match_url` for the external primary action.
|
||||
- Existing priority remains: `Ver partida` when `match_url` exists, otherwise internal `Ver detalles`.
|
||||
- Existing detail-page behavior already matched the task: it shows `Abrir en scoreboard` only when `match_url` exists and uses `target="_blank"` plus `rel="noopener noreferrer"`.
|
||||
- No CSS or markup change was needed.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `git status --short --branch` confirmed branch `plan/scoreboard-match-linking-tasks`.
|
||||
- `node --check frontend/assets/js/historico.js` passed.
|
||||
- `node --check frontend/assets/js/historico-partida.js` passed.
|
||||
- Static Node render check confirmed recent cards show `Ver partida` when `match_url` exists.
|
||||
- Static Node render check confirmed recent cards show `Ver detalles` when `match_url` is absent.
|
||||
- Static Node render check confirmed recent external links include `target="_blank"` and `rel="noopener noreferrer"`.
|
||||
- Static Node render check confirmed the detail-page action shows `Abrir en scoreboard` when `match_url` exists and hides when absent.
|
||||
- Static Node render check confirmed no `Comunidad Hispana #03` appears in the checked match-card states.
|
||||
- Static Node render check confirmed paused MVP/Elo UI does not surface in the checked match-card states.
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1` passed.
|
||||
- `git diff --name-only` and `git status --short` were reviewed. Changed files match the expected scope: `frontend/assets/js/historico.js` and this task file.
|
||||
|
||||
Note:
|
||||
|
||||
- The Browser plugin was not available as a callable browser automation tool in this session, so validation used the task-allowed static HTML/JS render checks instead of an in-browser screenshot pass.
|
||||
|
||||
## Change Budget
|
||||
|
||||
- Prefer fewer than 5 modified files.
|
||||
- Prefer changes under 200 lines when feasible.
|
||||
- Split follow-up work into a new task if the scope grows.
|
||||
164
ai/tasks/done/TASK-118-enrich-internal-match-detail-page.md
Normal file
164
ai/tasks/done/TASK-118-enrich-internal-match-detail-page.md
Normal file
@@ -0,0 +1,164 @@
|
||||
---
|
||||
id: TASK-118
|
||||
title: Enrich internal match detail page
|
||||
status: done
|
||||
type: frontend
|
||||
team: Frontend Senior
|
||||
supporting_teams:
|
||||
- Backend Senior
|
||||
- Experto en interfaz
|
||||
roadmap_item: historical-ui
|
||||
priority: medium
|
||||
---
|
||||
|
||||
# TASK-118 - Enrich internal match detail page
|
||||
|
||||
## Goal
|
||||
|
||||
Make the internal match detail page more useful when no scoreboard link exists.
|
||||
|
||||
## Context
|
||||
|
||||
The internal match detail page is the safe fallback for RCON synthetic matches and any match without a trusted external scoreboard URL. It should present all available local data clearly without trying to clone the external scoreboard site.
|
||||
|
||||
Use branch:
|
||||
|
||||
- `plan/scoreboard-match-linking-tasks`
|
||||
|
||||
## Steps
|
||||
|
||||
1. Work from this task only after moving it to `ai/tasks/in-progress/`.
|
||||
2. Inspect the listed files before changing anything.
|
||||
3. Show all available RCON/persisted fields clearly:
|
||||
- server
|
||||
- map
|
||||
- start
|
||||
- end
|
||||
- duration
|
||||
- average players
|
||||
- peak players
|
||||
- sample count
|
||||
- result if available
|
||||
- capture basis
|
||||
- capabilities
|
||||
4. If player-level data exists in persisted scoreboard storage, show a simple player table.
|
||||
5. If player-level data is unavailable, show a clear friendly message.
|
||||
6. Keep the visual style consistent with HLL Vietnam's sober military/Vietnam tactical identity.
|
||||
7. Do not attempt to fully clone the scoreboard site yet.
|
||||
8. Keep the page graceful for partial RCON data.
|
||||
9. Validate the result.
|
||||
10. Move this task to `ai/tasks/done/` only after validation is complete and document the outcome in this file.
|
||||
11. Commit and push the completed implementation branch.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `ai/architecture-index.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/orchestrator/frontend-senior.md`
|
||||
- `ai/orchestrator/ui-expert.md`
|
||||
- `ai/orchestrator/backend-senior.md`
|
||||
- `frontend/historico-partida.html`
|
||||
- `frontend/assets/js/historico-partida.js`
|
||||
- `frontend/assets/css/historico.css`
|
||||
- `backend/app/routes.py`
|
||||
- `backend/app/historical_storage.py`
|
||||
- `backend/app/rcon_historical_read_model.py`
|
||||
- `scripts/run-integration-tests.ps1`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- `frontend/historico-partida.html`
|
||||
- `frontend/assets/js/historico-partida.js`
|
||||
- possibly `frontend/assets/css/historico.css`
|
||||
- possibly `backend/app/routes.py`
|
||||
- possibly `backend/app/historical_storage.py`
|
||||
- possibly `backend/app/rcon_historical_read_model.py`
|
||||
- this task file, moved to `ai/tasks/done/`
|
||||
|
||||
If additional files become necessary, explain why in the task outcome and commit message.
|
||||
|
||||
## Expected Files Not to Modify
|
||||
|
||||
- historical ingestion policy/config
|
||||
- database migrations unless absolutely required and justified
|
||||
- persisted data
|
||||
- local `.env`
|
||||
- Docker/Compose config
|
||||
- Elo/MMR implementation files
|
||||
- unrelated frontend pages
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not reintroduce paused MVP/Elo UI.
|
||||
- Do not change historical ingestion policy.
|
||||
- Do not add real credentials.
|
||||
- Do not modify local `.env`.
|
||||
- Do not delete persisted data, migrations, backend endpoints or historical ingestion code.
|
||||
- Do not use the public word "snapshot" in user-facing UI.
|
||||
- Keep the page focused on local/internal match detail presentation.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task, run and document:
|
||||
|
||||
- `git status`
|
||||
- `node --check frontend/assets/js/historico-partida.js`
|
||||
- Python compile checks for touched backend modules, if any
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- served or static check confirming the internal detail page renders partial RCON data gracefully
|
||||
- served or static check confirming persisted scoreboard details render richer data when available
|
||||
- check confirming a friendly message appears when player-level data is unavailable
|
||||
- check confirming no Comunidad Hispana #03 appears
|
||||
- check confirming paused MVP/Elo UI remains absent
|
||||
- check confirming no public "snapshot" wording appears
|
||||
- `git diff --name-only` and confirmation that changed files match the expected scope
|
||||
|
||||
If a configured validation command cannot be run, document the exact reason in the outcome.
|
||||
|
||||
## Commit And Push Requirements
|
||||
|
||||
- Run validation before committing.
|
||||
- Run `git status`.
|
||||
- Stage only intended files.
|
||||
- Commit with message: `feat: enrich internal match detail page`
|
||||
- Push the branch to origin.
|
||||
- Do not leave completed work only in local.
|
||||
|
||||
## Outcome
|
||||
|
||||
Completed.
|
||||
|
||||
Implementation decisions:
|
||||
|
||||
- Enriched persisted public-scoreboard match detail payloads with `players` rows from local historical storage.
|
||||
- Added an empty `players` list for RCON competitive-window details so the frontend can treat partial RCON data gracefully.
|
||||
- Expanded the internal detail page summary to show server, map, start, end, duration, average players, peak players, sample count, result, capture basis and capabilities.
|
||||
- Added a simple player table for persisted player-level rows.
|
||||
- Added a friendly unavailable message for RCON windows or persisted matches without player rows.
|
||||
- Kept the page as a local/internal detail view and did not attempt to clone the external scoreboard.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `git status --short --branch` confirmed branch `plan/scoreboard-match-linking-tasks`.
|
||||
- `node --check frontend/assets/js/historico-partida.js` passed.
|
||||
- `python -m compileall backend/app` passed.
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1` passed.
|
||||
- Static Node render check confirmed partial RCON data renders gracefully with sample count, peak players and capability fields.
|
||||
- Static Node render check confirmed persisted scoreboard details render a player table when player rows are present.
|
||||
- Static Node render check confirmed the friendly no-player-data message appears when player-level data is unavailable.
|
||||
- Static Node render check confirmed no `Comunidad Hispana #03` appears.
|
||||
- Static Node render check confirmed paused MVP/Elo UI remains absent in the checked detail states.
|
||||
- Static Node render check confirmed no public `snapshot` wording appears in the checked detail states.
|
||||
- `$env:PYTHONPATH='backend'; python -m unittest backend.tests.test_scoreboard_match_links` passed after backend payload changes.
|
||||
- `git diff --name-only` and `git status --short` were reviewed. Changed files match the expected scope: match detail HTML/JS/CSS, backend detail payloads and this task file.
|
||||
|
||||
Note:
|
||||
|
||||
- The focused backend unittest still emits existing SQLite `ResourceWarning` messages from the repository connection helper pattern during forced cleanup, but all assertions pass.
|
||||
|
||||
## Change Budget
|
||||
|
||||
- Prefer fewer than 5 modified files.
|
||||
- Prefer changes under 200 lines when feasible.
|
||||
- Split follow-up work into a new task if the scope grows.
|
||||
@@ -0,0 +1,154 @@
|
||||
---
|
||||
id: TASK-119
|
||||
title: Add historical UI regression validation
|
||||
status: done
|
||||
type: platform
|
||||
team: Frontend Senior
|
||||
supporting_teams:
|
||||
- Backend Senior
|
||||
- PM
|
||||
roadmap_item: historical-ui
|
||||
priority: medium
|
||||
---
|
||||
|
||||
# TASK-119 - Add historical UI regression validation
|
||||
|
||||
## Goal
|
||||
|
||||
Add lightweight validation so future changes do not reintroduce removed UI or unsafe historical match-link behavior.
|
||||
|
||||
## Context
|
||||
|
||||
HLL Vietnam has intentionally removed Comunidad Hispana #03 from public/default flows, paused MVP/Elo UI, restored RCON-first historical policy and added internal match details. A small regression validation script/check should protect those decisions without adding heavy test infrastructure.
|
||||
|
||||
Use branch:
|
||||
|
||||
- `plan/scoreboard-match-linking-tasks`
|
||||
|
||||
## Steps
|
||||
|
||||
1. Work from this task only after moving it to `ai/tasks/in-progress/`.
|
||||
2. Inspect the listed files before changing anything.
|
||||
3. Extend or add validation scripts/checks compatible with the current repo.
|
||||
4. Check served or static frontend for:
|
||||
- no Comunidad Hispana #03 selector.
|
||||
- no MVP mensual V1/V2 blocks.
|
||||
- no Comparativa V1 vs V2.
|
||||
- no Elo/MMR public block.
|
||||
- no public "snapshot" wording.
|
||||
- recent cards include either `Ver partida` or `Ver detalles`.
|
||||
5. Check backend:
|
||||
- `/health` works.
|
||||
- historical source remains RCON-first.
|
||||
- match detail endpoint works.
|
||||
6. Keep validation lightweight and compatible with local PowerShell usage.
|
||||
7. Update documentation only if needed to explain how to run the new check.
|
||||
8. Validate the result.
|
||||
9. Move this task to `ai/tasks/done/` only after validation is complete and document the outcome in this file.
|
||||
10. Commit and push the completed implementation branch.
|
||||
|
||||
## Files to Read First
|
||||
|
||||
- `ai/architecture-index.md`
|
||||
- `ai/repo-context.md`
|
||||
- `ai/orchestrator/frontend-senior.md`
|
||||
- `ai/orchestrator/backend-senior.md`
|
||||
- `scripts/run-integration-tests.ps1`
|
||||
- `frontend/historico.html`
|
||||
- `frontend/assets/js/historico.js`
|
||||
- `frontend/historico-partida.html`
|
||||
- `frontend/assets/js/historico-partida.js`
|
||||
- `backend/app/config.py`
|
||||
- `backend/app/routes.py`
|
||||
- `docs/decisions.md`
|
||||
|
||||
## Expected Files to Modify
|
||||
|
||||
- `scripts/run-integration-tests.ps1` or a focused new validation script under `scripts/`
|
||||
- possibly documentation for the new validation command
|
||||
- possibly backend/frontend test fixtures only if needed
|
||||
- this task file, moved to `ai/tasks/done/`
|
||||
|
||||
If additional files become necessary, explain why in the task outcome and commit message.
|
||||
|
||||
## Expected Files Not to Modify
|
||||
|
||||
- product frontend behavior except minimal test hooks if absolutely required and justified
|
||||
- backend product behavior except minimal validation hooks if absolutely required and justified
|
||||
- database migrations
|
||||
- persisted data
|
||||
- local `.env`
|
||||
- Docker/Compose config unless required for validation and explicitly justified
|
||||
- Elo/MMR implementation files
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not reintroduce Comunidad Hispana #03.
|
||||
- Do not reintroduce paused MVP/Elo UI.
|
||||
- Do not change historical ingestion policy.
|
||||
- Do not add real credentials.
|
||||
- Do not modify local `.env`.
|
||||
- Do not delete persisted data, migrations, backend endpoints or historical ingestion code.
|
||||
- Do not use the public word "snapshot" in user-facing UI.
|
||||
- Keep validation lightweight; do not introduce unnecessary frameworks or dependencies.
|
||||
|
||||
## Validation
|
||||
|
||||
Before completing the task, run and document:
|
||||
|
||||
- `git status`
|
||||
- `node --check frontend/assets/js/historico.js`
|
||||
- `node --check frontend/assets/js/historico-partida.js` if present
|
||||
- Python compile checks for touched backend modules, if any
|
||||
- the new or updated historical UI regression validation
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`
|
||||
- check confirming `/health` works when the backend is served for validation
|
||||
- check confirming historical source remains RCON-first
|
||||
- check confirming the match detail endpoint works
|
||||
- check confirming no Comunidad Hispana #03, MVP mensual V1/V2, Comparativa V1 vs V2, Elo/MMR public block or public "snapshot" wording is present
|
||||
- check confirming recent cards include either `Ver partida` or `Ver detalles`
|
||||
- `git diff --name-only` and confirmation that changed files match the expected scope
|
||||
|
||||
If a configured validation command cannot be run, document the exact reason in the outcome.
|
||||
|
||||
## Commit And Push Requirements
|
||||
|
||||
- Run validation before committing.
|
||||
- Run `git status`.
|
||||
- Stage only intended files.
|
||||
- Commit with message: `test: add historical ui regression validation`
|
||||
- Push the branch to origin.
|
||||
- Do not leave completed work only in local.
|
||||
|
||||
## Outcome
|
||||
|
||||
Completed.
|
||||
|
||||
Implementation decisions:
|
||||
|
||||
- Added `scripts/run-historical-ui-regression-tests.ps1` as a lightweight PowerShell validation for historical UI guardrails.
|
||||
- Wired the new script into `scripts/run-integration-tests.ps1` so the regression checks run with the existing platform validation command.
|
||||
- Kept validation static/route-level by default to avoid adding frontend test frameworks or browser dependencies.
|
||||
- Added a separate served-backend validation during task execution for `/health` and match detail.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `git status --short --branch` confirmed branch `plan/scoreboard-match-linking-tasks`.
|
||||
- `node --check frontend/assets/js/historico.js` passed.
|
||||
- `node --check frontend/assets/js/historico-partida.js` passed.
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-historical-ui-regression-tests.ps1` passed.
|
||||
- `powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1` passed and now includes the historical UI regression validation.
|
||||
- Served backend check passed on `http://127.0.0.1:8765/health`.
|
||||
- Served backend check confirmed `/health` reports `historical_data_source` as `rcon`.
|
||||
- Served backend check passed for `/api/historical/matches/detail?server=comunidad-hispana-01&match=regression-check`.
|
||||
- Regression script confirms no `Comunidad Hispana #03` selector, no MVP mensual V1/V2 blocks, no Comparativa V1 vs V2 block, no Elo/MMR public block and no visible public `snapshot` wording in historical HTML.
|
||||
- Regression script confirms recent-card code includes `Ver partida` and `Ver detalles`.
|
||||
- Regression script confirms recent-card code does not trust legacy `source_url` fallback.
|
||||
- Regression script confirms external detail links keep `target="_blank"` and `rel="noopener noreferrer"`.
|
||||
- `git diff --name-only` and `git status --short` were reviewed. Changed files match the expected scope: validation scripts and this task file.
|
||||
|
||||
## Change Budget
|
||||
|
||||
- Prefer fewer than 5 modified files.
|
||||
- Prefer changes under 200 lines when feasible.
|
||||
- Split follow-up work into a new task if the scope grows.
|
||||
Reference in New Issue
Block a user