meshai/work/tests/fixtures/nws/0008.json
malice bdc42aa341
refactor(phase2): migrate nws + incident/roads to formatter+decider (tier-a) (#30)
Behavior-preserving relocation (byte-identical goldens), behind the staged-
cutover gate.

- formatters/nws.py + gating/nws.py: move _render + all CAP parsing (HTML-strip,
  _parse_nws_description, motion/hail/wind, county scoping, short-expiry) and the
  gating (3h re-alert window, Update/Cancel/Expire tombstone, first-sighting,
  warning->immediate severity). Native env/nws.py stops truncating description +
  carries parameters/eventCode/certainty/msgType/references/geocoder. Registers
  weather_warning + weather_statement.
- formatters/incident.py + gating/incident.py: absorb the incident _render AND
  the work_zone renderer, reconciling the two sub_type vocabularies; traffic_events
  change-detection gating. Native env/{traffic,roads511}.py emit canonical data.
  Registers work_zone/road_incident/road_closure/traffic_congestion.
- formatters/_anchor.py: shared town/distance/bearing resolver (consolidates WFIGS
  _location_anchor + incident nearest_town; WFIGS fire reuses in Phase 3).
- Fixtures captured: nws x37, traffic x46.

Tier-a byte-identical goldens for all fixtures. Tests: +~150; 0 new failures
(34 baseline, 1539 passed).

Co-authored-by: Matt Johnson <mj@k7zvx.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 18:16:34 -06:00

127 lines
No EOL
4.3 KiB
JSON

{
"envelope": {
"id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.c6add6b54c87dec0372f5cac3b3e3da2c46c6320.001.1",
"source": "central.echo6.co",
"type": "central.wx.alert.severe_thunderstorm_warning.v1",
"time": "2026-07-01T21:50:00+00:00",
"datacontenttype": "application/json",
"centralschemaversion": "1.0",
"centralcategory": "wx.alert.severe_thunderstorm_warning",
"centralseverity": 3,
"specversion": "1.0",
"data": {
"id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.c6add6b54c87dec0372f5cac3b3e3da2c46c6320.001.1",
"adapter": "nws",
"category": "wx.alert.severe_thunderstorm_warning",
"time": "2026-07-01T21:50:00Z",
"expires": "2026-07-01T22:30:00Z",
"severity": 3,
"geo": {
"centroid": [
-113.93199999999999,
42.224000000000004
],
"bbox": [
-114.16,
42.09,
-113.58,
42.47
],
"regions": [
"US-ID-C031",
"US-ID-FIPS16031"
],
"primary_region": "US-ID-C031",
"geometry": null
},
"data": {
"@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.c6add6b54c87dec0372f5cac3b3e3da2c46c6320.001.1",
"@type": "wx:Alert",
"id": "urn:oid:2.49.0.1.840.0.c6add6b54c87dec0372f5cac3b3e3da2c46c6320.001.1",
"areaDesc": "Cassia, ID",
"geocode": {
"SAME": [
"016031"
],
"UGC": [
"IDC031"
]
},
"affectedZones": [
"https://api.weather.gov/zones/county/IDC031"
],
"references": [],
"sent": "2026-07-01T15:50:00-06:00",
"effective": "2026-07-01T15:50:00-06:00",
"onset": "2026-07-01T15:50:00-06:00",
"expires": "2026-07-01T16:30:00-06:00",
"ends": "2026-07-01T16:30:00-06:00",
"status": "Actual",
"messageType": "Alert",
"category": "Met",
"severity": "Severe",
"certainty": "Observed",
"urgency": "Immediate",
"event": "Severe Thunderstorm Warning",
"sender": "w-nws.webmaster@noaa.gov",
"senderName": "NWS Pocatello ID",
"headline": "Severe Thunderstorm Warning issued July 1 at 3:50PM MDT until July 1 at 4:30PM MDT by NWS Pocatello ID",
"description": "SVRPIH\n\nThe National Weather Service in Pocatello has issued a\n\n* Severe Thunderstorm Warning for...\nSouthwestern Cassia County in southeastern Idaho...\n\n* Until 430 PM MDT.\n\n* At 350 PM MDT, a severe thunderstorm was located near Oakley\nReservoir, moving northeast at 20 mph.\n\nHAZARD...Quarter size hail.\n\nSOURCE...Radar indicated.\n\nIMPACT...Damage to vehicles is expected.\n\n* Locations impacted include...\nOakley Reservoir and Oakley.",
"instruction": "For your protection move to an interior room on the lowest floor of a\nbuilding.\n\nTorrential rainfall is occurring with this storm, and may lead to\nflash flooding. Do not drive your vehicle through flooded roadways.",
"response": "Shelter",
"note": null,
"parameters": {
"AWIPSidentifier": [
"SVRPIH"
],
"WMOidentifier": [
"WUUS55 KPIH 012150"
],
"eventMotionDescription": [
"2026-07-01T21:50:00-00:00...storm...246DEG...17KT...42.22,-114.01"
],
"windThreat": [
"RADAR INDICATED"
],
"maxWindGust": [
"Up to 50 MPH"
],
"hailThreat": [
"RADAR INDICATED"
],
"maxHailSize": [
"1.00"
],
"BLOCKCHANNEL": [
"EAS",
"NWEM",
"CMAS"
],
"EAS-ORG": [
"WXR"
],
"VTEC": [
"/O.NEW.KPIH.SV.W.0027.260701T2150Z-260701T2230Z/"
],
"eventEndingTime": [
"2026-07-01T16:30:00-06:00"
]
},
"scope": "Public",
"code": "IPAWSv1.0",
"language": "en-US",
"web": "http://www.weather.gov",
"eventCode": {
"SAME": [
"SVR"
],
"NationalWeatherService": [
"SVW"
]
}
}
}
},
"subject": "central.wx.alert.us.id.county.c031",
"captured_epoch": 1783206513
}