Add TFL train disruption alerts integration

Query TFL API for Tube and Elizabeth Line status, displaying
disruptions as feed cards. Major disruptions (severity 1-6) appear
as RIGHT_NOW spotlight cards, minor delays (7-9) as FYI items.

- Add TFLDataSource with 2-min cache and severity classification
- Add .transitAlert FeedItemType with 0.85 base weight
- Wire up async fetch in ContextOrchestrator pipeline
- Handle timeout and failure cases gracefully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-10 21:46:23 +00:00
parent b6ff4e81e9
commit e15be9ddc4
4 changed files with 256 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ final class HeuristicRanker {
switch type {
case .weatherWarning: return 1.0
case .weatherAlert: return 0.9
case .transitAlert: return 0.85
case .calendarEvent: return 0.8
case .transit: return 0.75
case .poiNearby: return 0.6

View File

@@ -17,5 +17,6 @@ enum FeedItemType: String, Codable, CaseIterable {
case currentWeather = "CURRENT_WEATHER"
case calendarEvent = "CALENDAR_EVENT"
case stock = "STOCK"
case transitAlert = "TRANSIT_ALERT"
case allQuiet = "ALL_QUIET"
}