Commit Graph
36 Commits
Author SHA1 Message Date
dasemuandClaude Sonnet 5 d99aed9a3c chore: bootstrap Claude setup
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-18 15:02:48 +02:00
dasemu b4453917dc docs: update documentation for new features and recent changes
- Remove references to deprecated bot commands (/pajares, /sanisidro, /fuentes, /all)
- Document new /suscribir and /desuscribir subscription commands
- Add push notification system description and usage
- Document admin accuracy reports with environment variable setup
- Add sky_condition and snow_type fields to API spec and database schema
- Update scheduled task description (training day changed from Monday to Sunday)
- Add notification_subscribers table to schema
- Update DEPLOYMENT.md with ADMIN_TELEGRAM_IDS environment variable
- Mark completed milestones in TODO.md
2026-03-17 18:26:06 +01:00
dasemu 2e40eee95a Merge branch 'feature/weather-sky-snow-type' 2026-03-17 17:57:28 +01:00
dasemu 39e08fbe6f Merge branch 'feature/admin-accuracy-reports'
# Conflicts:
#	app/scheduler/tasks.py
2026-03-17 17:56:53 +01:00
dasemu 413489b590 Merge branch 'feature/push-notifications' 2026-03-17 17:55:54 +01:00
dasemu 70e3a1cf92 feat(weather): add sky conditions and snow type to predictions
Add WMO weather_code from Open-Meteo to derive sky conditions
(sunny/cloudy/foggy/storm) and infer snow type (powder/hard/wet/spring)
from temperature and snowfall data. Both fields flow through the full
pipeline: weather API, hybrid predictor, SQLite storage, REST API
schemas, Telegram bot messages, and scheduler tasks.
2026-03-17 17:54:43 +01:00
dasemu 680719666a feat(accuracy): add admin accuracy reports with divergence metrics 2026-03-17 17:47:39 +01:00
dasemu 32d8b07786 refactor(bot): remove /all and station-specific commands 2026-03-17 17:46:42 +01:00
dasemu 61b4d8334d feat(bot): add daily push notification subscription system
Add /suscribir and /desuscribir commands to the Telegram bot so users
can opt in to receive the next-day prediction automatically at 20:00
when the extended task fires. Subscribers are persisted in a new
notification_subscribers SQLite table with soft-delete semantics.
2026-03-17 17:46:02 +01:00
dasemu 5e2a22340f refactor(crowd_analysis): simplify table + upgrade YOLO + add regional holidays
- Remove internal YOLO counts (cars/people/buses/total_vehicles) from crowd_analysis table
- Keep only crowd_density and confidence_scores for persistence (no ML training impact)
- Upgrade from YOLOv8n to YOLOv11m for better person detection (fewer false positives)
- Add regional holidays: Día de Castilla y León (4/23), Santiago Apóstol (7/25, shared with Galicia)
- Add Easter Monday (moveable, 2018-2035) for Castilla y León and Galicia
- Update all tests to match simplified crowd_analysis schema

Tests: all 38 SQLite/crowd_analyzer tests + 13 feature tests passing.
2026-03-13 18:03:15 +01:00
dasemu fa7d61b7db Hola 2026-03-13 15:10:37 +01:00
dasemu f63913b23c fix(setup): enforce webcam crowd labels 2026-03-13 12:09:42 +01:00
dasemu f6a65f41d9 feat: unified architecture and webcam archive optimization
- Refactor backend into a single process (FastAPI + APScheduler + Telegram Bot)
- Implement 'current_forecasts' and 'past_forecasts' architecture in storage
- Optimize historical webcam collector with date range discovery for Pajares, San Isidro, and Fuentes
- Clean up legacy scripts and tables (prediction_runs, prediction_stations)
- Update tests and operations documentation
2026-03-13 11:56:59 +01:00
dasemu a70eff3e45 merge: clean predictor debt
# Conflicts:
#	predictor/rules.py
2026-03-13 10:52:48 +01:00
dasemu e6add1b727 fix(core): clean predictor debt 2026-03-13 10:51:29 +01:00
dasemu 49580ec010 feat(rules): refactor rules to be deterministic and add validation script 2026-03-13 10:45:59 +01:00
dasemu d2f543f19c chore: add ultralytics to requirements.txt 2026-03-13 10:42:29 +01:00
dasemu b4c6041eea feat(crowd): add automated historical webcam collection and dataset integration 2026-03-13 10:41:57 +01:00
dasemu e952cea417 docs: update API, deployment, and lessons for the new backend
- Updated API_SPEC.md with JWT auth and storage schema.
- Updated DEPLOYMENT.md for the new uvicorn-based setup.
- Added LESSONS.md pattern for worktree management.
- Included new README, TODO, and OPERATIONS files.
2026-03-13 10:01:48 +01:00
dasemu b5b62e582e fix(ml): resolve km_open under-prediction and remove Rule 3
- Removed data leakage features (lifts_open, snow_depth) from ML training.
- Added station_id as an encoded categorical feature to enable station-awareness.
- Removed Rule 3 (warm rain reduction) from the rules engine to avoid double-penalization.
- Retrained all models with the corrected feature set.
2026-03-13 10:01:43 +01:00
dasemu 6aa37f88e7 Merge branch 'feat/jwt-auth' 2026-03-13 09:36:23 +01:00
dasemu 9d97afe538 feat(api): add FastAPI backend with JWT authentication
REST API serving forecast data with HS256 JWT auth (14-day tokens).
Public: /health, /auth/register, /auth/login.
Protected: /stations, /forecast, /forecast/history, /forecast/{id}, /status.
Includes APScheduler for periodic forecasts and Telegram bot subprocess.
2026-03-13 09:36:18 +01:00
dasemu 4daa733039 feat(ml): implement sample weighting by date recency
Prioritize recent historical data to account for potential changes in
data collection methodology at Infonieve over the years.
Implemented linear weight decay from 1.0 (newest) to 0.2 (oldest).
2026-03-13 09:35:47 +01:00
dasemu c8188e3995 docs(lessons): record main checkout rule 2026-03-13 08:45:09 +01:00
dasemu a6bfc69894 chore(start): load env before bot launch 2026-03-13 08:45:05 +01:00
dasemu 04eb0fde61 fix(data): normalize station history dates 2026-03-13 08:45:00 +01:00
dasemu 2a34054399 feat(bot): add horizon commands 2026-03-13 08:40:55 +01:00
dasemu 00efa356c3 docs: add git worktree mandatory workflow to agents and lessons 2026-03-13 06:55:45 +01:00
dasemu c486c585d0 merge: sqlite migration
# Conflicts:
#	bot/telegram_bot.py
2026-03-13 06:52:40 +01:00
dasemu 9c8ba03574 feat(storage): migrate project to sqlite 2026-03-13 06:50:18 +01:00
dasemu b690e82f98 feat(bot): translate all telegram bot messages to spanish 2026-03-13 06:27:17 +01:00
dasemu 1bc1e58781 fix(pipeline): anchor features to target date 2026-03-12 19:04:56 +01:00
dasemu e14a9f2d3b fix(pipeline): preserve historical features 2026-03-12 16:49:46 +01:00
dasemu 4933c61c69 fix(bot): read current prediction schema 2026-03-12 16:31:01 +01:00
dasemu dabadb105b fix(bot): migrate message formatting from MarkdownV2 to HTML 2026-03-12 16:17:11 +01:00
dasemu 1afe2b73e0 feat: initial ski predictor system
Hybrid ML + rules prediction system for 3 Asturian ski stations
(Pajares, San Isidro, Fuentes de Invierno).

- Weather data from Open-Meteo (historical + forecast)
- Station scraping from infonieve.es (live + 16 seasons historical TSV)
- Feature engineering: rolling snow, calendar, temperature/pressure trends
- ML models: RandomForest (open/close), GradientBoosting (km), LightGBM (crowd)
- Rules engine: wind closure, snow depth, rain+heat, heavy snow
- YOLOv8 webcam crowd detection (cars, people in parking/lifts)
- Telegram bot with /pajares, /sanisidro, /fuentes commands
- Daily cron pipeline for automated data collection and predictions
- Deployment guide with systemd service and cron setup
2026-03-12 14:51:32 +01:00