meshai/work/tests/fixtures/nws_last/0000.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

118 lines
No EOL
3.9 KiB
JSON

{
"envelope": {
"id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.77e566f81234fa136014003ec08b0d965ee7b4dc.001.1",
"source": "central.echo6.co",
"type": "central.wx.alert.special_weather_statement.v1",
"time": "2026-06-27T23:16:00+00:00",
"datacontenttype": "application/json",
"centralschemaversion": "1.0",
"centralcategory": "wx.alert.special_weather_statement",
"centralseverity": 2,
"specversion": "1.0",
"data": {
"id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.77e566f81234fa136014003ec08b0d965ee7b4dc.001.1",
"adapter": "nws",
"category": "wx.alert.special_weather_statement",
"time": "2026-06-27T23:16:00Z",
"expires": "2026-06-27T23:45:00Z",
"severity": 2,
"geo": {
"centroid": [
-116.13,
41.762
],
"bbox": [
-116.29,
41.68,
-115.89,
41.92
],
"regions": [
"US-NV-FIPS32007",
"US-NV-Z031"
],
"primary_region": "US-NV-FIPS32007",
"geometry": null
},
"data": {
"@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.77e566f81234fa136014003ec08b0d965ee7b4dc.001.1",
"@type": "wx:Alert",
"id": "urn:oid:2.49.0.1.840.0.77e566f81234fa136014003ec08b0d965ee7b4dc.001.1",
"areaDesc": "Northern Elko County",
"geocode": {
"SAME": [
"032007"
],
"UGC": [
"NVZ031"
]
},
"affectedZones": [
"https://api.weather.gov/zones/forecast/NVZ031"
],
"references": [],
"sent": "2026-06-27T16:16:00-07:00",
"effective": "2026-06-27T16:16:00-07:00",
"onset": "2026-06-27T16:16:00-07:00",
"expires": "2026-06-27T16:45:00-07:00",
"ends": null,
"status": "Actual",
"messageType": "Alert",
"category": "Met",
"severity": "Moderate",
"certainty": "Observed",
"urgency": "Expected",
"event": "Special Weather Statement",
"sender": "w-nws.webmaster@noaa.gov",
"senderName": "NWS Elko NV",
"headline": "Special Weather Statement issued June 27 at 4:16PM PDT by NWS Elko NV",
"description": "At 416 PM PDT, Doppler radar was tracking a strong thunderstorm\ncapable of producing a landspout 13 miles southwest of Owyhee, moving\nnortheast at 25 mph.\n\nHAZARD...Landspouts, wind gusts up to 40 mph, and half inch hail.\n\nSOURCE...Radar indicated.\n\nIMPACT...Minor damage to outdoor objects is possible. Gusty winds\ncould knock down tree limbs and blow around unsecured\nobjects.\n\nLocations impacted include...\nMountain City.",
"instruction": "If outdoors, consider seeking shelter inside a building.",
"response": "Execute",
"note": null,
"parameters": {
"AWIPSidentifier": [
"SPSLKN"
],
"WMOidentifier": [
"WWUS85 KLKN 272316"
],
"NWSheadline": [
"A STRONG THUNDERSTORM WILL IMPACT NORTH CENTRAL ELKO COUNTY THROUGH 445 PM PDT"
],
"eventMotionDescription": [
"2026-06-27T23:16:00-00:00...storm...241DEG...22KT...41.76,-116.21"
],
"maxWindGust": [
"40 MPH"
],
"maxHailSize": [
"0.50"
],
"BLOCKCHANNEL": [
"EAS",
"NWEM",
"CMAS"
],
"EAS-ORG": [
"WXR"
]
},
"scope": "Public",
"code": "IPAWSv1.0",
"language": "en-US",
"web": "http://www.weather.gov",
"eventCode": {
"SAME": [
"SPS"
],
"NationalWeatherService": [
"SPS"
]
}
}
}
},
"subject": "central.wx.alert.us.nv.county.fips32007",
"captured_epoch": 1783206518
}