meshai/work/tests/fixtures/traffic_last/0002.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

169 lines
No EOL
4.6 KiB
JSON

{
"envelope": {
"id": "idaho_511:event:11501",
"source": "central.echo6.co",
"type": "central.work_zone.itd_511.v1",
"time": "2026-07-03T23:29:03+00:00",
"datacontenttype": "application/json",
"centralschemaversion": "1.0",
"centralcategory": "work_zone.itd_511",
"centralseverity": 1,
"specversion": "1.0",
"data": {
"id": "idaho_511:event:11501",
"adapter": "itd_511",
"category": "work_zone.itd_511",
"time": "2026-07-03T23:29:03Z",
"expires": "2026-08-17T12:00:00Z",
"severity": 1,
"geo": {
"centroid": [
-112.46636,
42.9205
],
"bbox": null,
"regions": [
"US-ID"
],
"primary_region": "US-ID",
"geometry": {
"type": "LineString",
"coordinates": [
[
-112.46636,
42.9205
],
[
-112.46636,
42.92115
],
[
-112.46637,
42.92138
],
[
-112.46637,
42.92163
],
[
-112.46638,
42.92178
],
[
-112.46638,
42.92197
],
[
-112.46639,
42.92235
],
[
-112.46639,
42.92318
],
[
-112.4664,
42.92357
],
[
-112.46642,
42.92472
],
[
-112.46642,
42.92557
],
[
-112.46641,
42.9258
],
[
-112.46641,
42.92601
],
[
-112.4664,
42.92667
],
[
-112.46642,
42.92689
],
[
-112.46643,
42.92742
]
]
}
},
"data": {
"event_type_short": "work_zone",
"event_sub_type": "roadConstruction",
"roadway_name": "US-91",
"direction": "South",
"description": "Road construction on US-91 Southbound from W Chubbuck Rd to Highway Ave. 1 Right lane closed. 7/6/2026 8:00 PM to 8/17/2026 6:00 AM Mon, Tue, Wed, Thu, Fri, Sat, Sun: Active all day Width Restriction: 12ft",
"lanes_affected": "1 Right lane closed",
"is_full_closure": false,
"itd_severity": "None",
"comment": "Concrete pavement repair and replacement project. Waterline work. Traffic Control - Jacob Greenburg (208) 272-1741 [Idaho Traffic Safety]; Contractor - Russ Jensen (208 680-6288 [Cannon Builders Inc.]",
"cause": "roadwork",
"organization": "ERS",
"recurrence_text": "<b>Mon, Tue, Wed, Thu, Fri, Sat, Sun:</b><br/>Active all day<br/><br/>",
"recurrence_schedules": [
{
"StartDate": "7/6/2026 8:00:00 PM-06:00:00",
"EndDate": "8/17/2026 6:00:00 AM-06:00:00",
"Times": [
{
"StartTime": "00:00:00-06:00:00",
"EndTime": "23:59:59-06:00:00"
}
],
"DaysOfWeek": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
]
}
],
"restrictions": {
"Width": 12.0,
"Height": null,
"Length": null,
"Weight": null,
"Speed": null
},
"detour_polyline": null,
"detour_instructions": null,
"encoded_polyline": "c|}dGvammTaC?m@@q@?]@e@?kA@eD?mA@eFBiD?m@Ai@?cCAk@BiB@",
"id_internal": 40622,
"source_id": "11501",
"reported_epoch": 1783389600,
"last_updated_epoch": 1783121343,
"start_epoch": 1783389600,
"planned_end_epoch": 1786968000,
"latitude": 42.9204972258541,
"longitude": -112.46636,
"_enriched": {
"geocoder": {
"name": "Chubbuck",
"city": null,
"county": "Bannock",
"state": "Idaho",
"country": "United States",
"postal_code": "83202",
"timezone": "America/Boise",
"landclass": null,
"elevation_m": 1363.3203125
}
}
}
}
},
"subject": "central.traffic.work_zone.us.id",
"captured_epoch": 1783206522
}