MCD state extraction matches "in"/"or" as Indiana/Oregon — anchor to AREAS AFFECTED #43
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#43
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
_extract_states_from_text(app/services/spc.py:245-249) runs the two-letterstate-abbreviation regex over the entire uppercased MCD narrative, so common
English words match as states (verified: a geography-free sentence yields
{'OR','IN'})._process_mcd_for_subgates on membership in that set, soIN/OR/ME/OK/HI/CO locations get essentially random MCD notifications.
Fix: parse the
AREAS AFFECTED...section (present in MCD product text) andextract states from that line only (abbreviations and full names); fall back to
full-name matching over the narrative when the section is absent. Add tests
using realistic MCD text including bare "in"/"or" tokens.
Acceptance criteria:
Filed from the 2026-07-17 codebase audit (
docs/.internal/report-2026-07-17.md), finding F-04.Fixed in #92 (merged to
main)._extract_states_from_textnow parses theAREAS AFFECTEDline (abbreviations + full names) and only falls back to full-name matching over the narrative when that line is absent — bare two-letter tokens are never matched across the whole text. Tests cover plain-English narratives (zero states) and IN/OR collision words.