Fetch SPC day 4–8 outlook text as the combined SWOD48 product (#161) #163
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!163
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/spc-swod48"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #161.
Problem
SPC issues days 4–8 as one combined text product (AWIPS
SWOD48/ WMOACUS48); the per-daySWODY4–SWODY8ids this code requested don't exist. Verified against the live NWS API: recentSWOproducts areSWODY1/2/3andSWOD48only. The five fetches failed on every 5-minute cycle (~26k consecutive failures on prod) and permanently tripped the dashboard degraded-data banner — while it displayed a seconds-old "last update" from the healthy day-1–3 keys. That's the "freshness warning despite updating a minute ago" contradiction reported after the prod migration.Change
nws.py: days 4–8 route to_fetch_swod48_text()(AWIPSSWOD48, WMOACUS48), recorded under the single freshness keyspc:text_swod48. The per-day maps now cover days 1–3 only. Out-of-range days still returnNone.api/alerts.py/spc_processor.py: the combined product is fetched once per cycle and shared across days 4–8, instead of five identical HTTP requests + five freshness writes.ai_context.py: freshness-key derivation maps day ≥ 4 tospc:text_swod48.spc:text_swody4..8rows. Nothing writes those keys anymore, and any row withfailure_count > 0keeps the banner degraded forever, so they must be removed rather than left to age out.Tests
New: day-4 resolves to SWOD48 via mocked NWS API and records
text_swod48; days 4–8 all share the combined fetch; out-of-range days returnNone. Existing SWODY1 and fire-outlook tests unchanged. Test patches offetch_spc_outlook_textkeep working — the public signature is unchanged.Note per [migration-real-db-verify]: 0033 is a pure
DELETE(no constraints added), so the empty-DB CI migration run is representative; the five rows exist on prod and dev and will be removed on deploy.🤖 Generated with Claude Code