4.3 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | |
|---|---|---|---|---|---|---|---|---|
| TASK-140 | Restore historical runner Elo imports | done | backend | Backend Senior |
|
foundation | high |
TASK-140 - Restore historical runner Elo imports
Goal
Restore historical-runner startup by fixing the Elo/MMR model import contract used by app.elo_mmr_engine.
Context
The advanced historical-runner service runs python -m app.historical_runner --hourly and intentionally imports rebuild_elo_mmr_models. The engine imports scoring constants from app.elo_mmr_models, but that module no longer exports every constant required by the engine.
Steps
- Inspect the listed files first.
- Restore the missing Elo/MMR model/config constants in the correct module.
- Keep the change narrow and avoid disabling the runner or Elo/MMR silently.
- Validate the backend, RCON data pipeline, integration tests, advanced Compose services and relevant HTTP endpoints.
Files to Read First
ai/architecture-index.mdai/repo-context.mdai/orchestrator/backend-senior.mdbackend/app/historical_runner.pybackend/app/historical_ingestion.pybackend/app/elo_mmr_engine.pybackend/app/elo_mmr_models.pybackend/app/elo_mmr_storage.py
Expected Files to Modify
backend/app/elo_mmr_models.py.gitignoreai/tasks/done/TASK-140-fix-historical-runner-elo-import.md
Constraints
- Do not remove or disable
historical-runner. - Do not disable Elo/MMR silently.
- Do not modify frontend files.
- Do not reintroduce Comunidad Hispana #03.
- Do not commit runtime database files.
- Preserve RCON ingestion, AdminLog materialization, recent matches, match detail and scoreboard candidate backfill.
Validation
python -m compileall backend/apppowershell -ExecutionPolicy Bypass -File scripts/run-rcon-data-pipeline-tests.ps1powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1docker compose --profile advanced up -d --build backend frontend historical-runner rcon-historical-workerdocker compose --profile advanced psdocker compose logs --tail=100 historical-runnerInvoke-WebRequest "http://localhost:8000/health" | Select-Object -ExpandProperty ContentInvoke-WebRequest "http://localhost:8000/api/historical/recent-matches?server=all-servers&limit=20" | Select-Object -ExpandProperty Content
Outcome
Implemented the import-contract fix by restoring the missing Elo/MMR model constants exported from backend/app/elo_mmr_models.py:
ELO_K_FACTORMIN_VALID_PLAYER_PARTICIPATION_SECONDSMIN_VALID_PLAYER_PARTICIPATION_RATIO
The constants live with the rest of the Elo/MMR model thresholds, preserving the existing app.elo_mmr_engine import boundary and avoiding any silent disabling of the runner or Elo/MMR. .gitignore now also ignores backend/data/*.writer.lock because advanced Compose validation creates the shared SQLite writer lock as runtime state.
Validation completed:
python -m compileall backend/app- Direct imports of
app.historical_runner,app.historical_ingestionandapp.elo_mmr_engine powershell -ExecutionPolicy Bypass -File scripts/run-rcon-data-pipeline-tests.ps1powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1docker compose --profile advanced up -d --build backend frontend historical-runner rcon-historical-workerdocker compose --profile advanced psdocker compose logs --tail=100 historical-runnerInvoke-WebRequest "http://localhost:8000/health" | Select-Object -ExpandProperty ContentInvoke-WebRequest "http://localhost:8000/api/historical/recent-matches?server=all-servers&limit=20" | Select-Object -ExpandProperty ContentInvoke-WebRequest "http://localhost:8080/historico.html?nocache=runner" | Select-Object -ExpandProperty StatusCode
Manual verification:
historical-runnerstayedUpin the advanced profile.rcon-historical-workerstayedUp.historical-runnerlogs showedhistorical-refresh-loop-startedand noImportError./healthreturnedstatus: "ok"./api/historical/recent-matchesreturned RCON-backed recent match data.historico.htmlreturned HTTP 200.- No frontend files were modified.
- No runtime database files were staged or committed.
Change Budget
- Prefer fewer than 5 modified files.
- Prefer changes under 200 lines when feasible.