Implement trusted scoreboard origins, persisted scoreboard links, RCON-to-scoreboard correlation, match link UX priority, enriched internal match details, and historical UI regression validation.
5.6 KiB
5.6 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | ||
|---|---|---|---|---|---|---|---|---|---|
| TASK-115 | Resolve persisted scoreboard links | done | backend | Backend Senior |
|
historical | 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
- Work from this task only after moving it to
ai/tasks/in-progress/. - Inspect the listed files before changing anything.
- Inspect historical storage detail and recent match payloads.
- Ensure recent match list responses return
match_urlwhenraw_payload_refexists and passes trusted origin validation. - Ensure the match detail endpoint returns
match_urlfor persisted scoreboard matches whenraw_payload_refexists and passes trusted origin validation. - Do not use RCON synthetic IDs for this task.
- Do not fabricate external URLs when no trusted persisted URL exists.
- Add tests or focused checks if feasible in the current repo.
- Validate the result.
- Move this task to
ai/tasks/done/only after validation is complete and document the outcome in this file. - Commit and push the completed implementation branch.
Files to Read First
ai/architecture-index.mdai/repo-context.mdai/orchestrator/backend-senior.mdbackend/app/historical_storage.pybackend/app/historical_snapshots.pybackend/app/payloads.pybackend/app/routes.py- backend trusted scoreboard origin helper/config from TASK-114
backend/tests/if presentscripts/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_urlexposure 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_urlwhen 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-onlyand 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_urlresolution through the trusted scoreboard origin catalog. - Added
backend/tests/test_scoreboard_match_links.pyas a focused stdlibunittestregression 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 --branchconfirmed branchplan/scoreboard-match-linking-tasks.$env:PYTHONPATH='backend'; python -m unittest backend.tests.test_scoreboard_match_linkspassed.python -m compileall backend/app backend/testspassed.powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1passed.- 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-onlyandgit status --shortwere reviewed. Changed files match the expected scope: backend test coverage plus this task file.
Note:
- The focused unittest emits existing SQLite
ResourceWarningmessages 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.