5.8 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | ||
|---|---|---|---|---|---|---|---|---|---|
| TASK-POSTGRES-RCON-PHASE-1 | Migrate RCON historical persistence phase 1 | done | backend | Backend Senior |
|
foundation | high |
TASK-POSTGRES-RCON-PHASE-1 - Migrate RCON historical persistence phase 1
Goal
Move the lock-prone RCON historical pipeline to PostgreSQL in Docker while keeping local SQLite fallback and fixing the requested match-detail and server card frontend regressions.
Context
AdminLog ingestion and materialization currently share SQLite files with
multiple services and materialization can fail with database is locked.
PostgreSQL must become authoritative for RCON capture, AdminLog events,
materialized matches, player stats and the detail/recent read model in the
advanced Docker flow. Scoreboard historical persistence may remain on SQLite in
this phase when it is used only as fallback or correlation source.
Steps
- Inspect the storage, read-model and frontend files named in the request.
- Add a deterministic PostgreSQL schema and route the phase-1 RCON storage
domains through it when
HLL_BACKEND_DATABASE_URLis set. - Wire Compose diagnostics and required frontend fixes without expanding Elo, backend scope outside RCON persistence, or Comunidad Hispana #03 targets.
- Validate the requested commands, document what remains SQLite-backed, and complete the task record.
Files to Read First
ai/architecture-index.mdai/repo-context.mdbackend/app/config.pybackend/app/rcon_admin_log_storage.pybackend/app/rcon_admin_log_materialization.pyfrontend/assets/js/historico-partida.js
Expected Files to Modify
backend/app/config.pybackend/app/postgres_rcon_storage.pybackend/app/rcon_admin_log_storage.pybackend/app/rcon_admin_log_materialization.pybackend/app/rcon_historical_storage.pybackend/app/rcon_scoreboard_correlation.pybackend/app/storage_diagnostics.pybackend/README.mdbackend/requirements.txtbackend/.env.exampledocker-compose.ymlfrontend/assets/js/historico-partida.jsfrontend/assets/js/historico.jsfrontend/assets/js/historico-recent-live.jsfrontend/assets/js/main.jsfrontend/assets/css/historico-scoreboard-detail.cssdocs/decisions.mdscripts/run-historical-ui-regression-tests.ps1
Constraints
- PostgreSQL is the Docker default for migrated RCON domains.
- SQLite remains only fallback or source material for domains not migrated in this phase.
- Do not add SQLite lock workarounds as the main solution.
- Keep external scoreboard URLs on the trusted scoreboard allowlist.
- Do not modify unrelated files or add runtime database artifacts.
Validation
python -m compileall backend/apppython -m app.storage_diagnosticsnode --check frontend/assets/js/main.jsnode --check frontend/assets/js/historico.jsnode --check frontend/assets/js/historico-recent-live.jsnode --check frontend/assets/js/historico-partida.jspowershell -ExecutionPolicy Bypass -File scripts/run-rcon-data-pipeline-tests.ps1powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1- Requested Docker Compose and endpoint checks when local Docker/RCON credentials permit them.
Outcome
Implemented phase-1 PostgreSQL delegation for RCON capture samples/windows,
AdminLog events/profile snapshots, materialized RCON matches/player stats, and
safe scoreboard candidate caching. Docker Compose now configures PostgreSQL as
the RCON storage backend for backend, historical-runner and
rcon-historical-worker; local code paths with explicit SQLite paths or no
database URL retain SQLite fallback behavior.
Frontend changes remove hover-driven player panel expansion in the internal match detail table, keep the scoreboard link on the internal detail action area only, and suppress pending-style region placeholders on server cards.
Validation completed:
python -m compileall backend/apppython -m app.storage_diagnosticsfrombackend/node --check frontend/assets/js/main.jsnode --check frontend/assets/js/historico.jsnode --check frontend/assets/js/historico-recent-live.jsnode --check frontend/assets/js/historico-partida.jspowershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1docker compose --profile advanced config --quiet- local fallback HTTP smoke for
/health,/api/historical/recent-matches, and the requested known match detail URL - direct known-match detail payload check confirmed safe URL
https://scoreboard.comunidadhll.es:5443/games/1562094
scripts/run-rcon-data-pipeline-tests.ps1 completed parser/storage and
unittest work, then exited nonzero when its optional Docker smoke step could
not reach the Docker Desktop Linux engine. The requested docker compose --profile advanced up ... and docker compose --profile advanced ps checks
failed for the same local engine-unavailable reason, so container diagnostics,
container RCON commands and Docker-backed HTTP probes remain to rerun when
Docker is available. The Browser plugin is listed but its required JavaScript
control tool was not exposed in this session, so rendered interaction QA remains
manual or follow-up Browser verification.
Phase boundary documented in docs/decisions.md and diagnostics: live server
snapshot cache, public-scoreboard historical_* data/rankings, historical
snapshot files, player-event ledger and paused Elo/MMR storage remain SQLite or
file-backed in this phase.
Change Budget
This phase intentionally exceeds the default change budget because PostgreSQL wiring crosses schema initialization, Compose runtime, RCON storage domains, diagnostics, docs, and the requested frontend regressions. Keep the migration surface limited to the RCON path and leave remaining SQLite domains documented.