fix(pipeline): preserve historical features

This commit is contained in:
dasemu committed 2026-03-12 16:49:46 +01:00
1 parent 4933c61c69
commit e14a9f2d3b
3 files changed
+137 -35

No files matched your search

+3 -3
View File
@@ -2,10 +2,10 @@
**What went wrong:** I assumed the Telegram bot running on the server might differ from the repository after seeing a schema mismatch between the bot code and the predictions JSON.
**Root cause:** I inferred deployment drift before exhausting the simpler explanation: the repository bot itself still expected the old JSON schema and would therefore fail even when code and server were synchronized.
**Root cause:** I inferred deployment drift before exhausting the simpler explanation: the repository bot itself still expected the old JSON schema and would therefore fail even when code and server were synchronized. I also failed to apply the repository-specific operating assumption that production runs on the server unless the user explicitly says otherwise.
**Prevention rule:** In this repository, when the user states the server and repo are synchronized, treat that as the default assumption and first verify whether the bug is reproducible directly from the checked-in code before attributing it to deployment drift.
**Prevention rule:** In this repository, unless the user explicitly says otherwise, assume production deployment lives on the server even if development happens locally. When the user states the server and repo are synchronized, treat that as the default assumption and first verify whether the bug is reproducible directly from the checked-in code before attributing it to deployment drift.
**Example:** `bot/telegram_bot.py` expected top-level station keys plus legacy fields like `station_open_probability`, while `scripts/collect_daily_data.py` writes predictions under `stations` with fields such as `open_probability` and `km_open`.
**Example:** The production JSON at `/opt/skipredictor/data/processed/predictions_latest.json` on the server contained valid predictions under `stations`, and the checked-in [telegram_bot.py](/home/dasemu/Hacking/Darío Sevilla/skipredictor/bot/telegram_bot.py) still expected top-level station keys plus legacy fields like `station_open_probability`, while [collect_daily_data.py](/home/dasemu/Hacking/Darío Sevilla/skipredictor/scripts/collect_daily_data.py) writes predictions under `stations` with fields such as `open_probability` and `km_open`.
**Files affected:** `bot/telegram_bot.py`, `scripts/collect_daily_data.py`