meshai/work/tests/fixtures/traffic/0032.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

92 lines
No EOL
2.7 KiB
JSON

{
"envelope": {
"id": "idaho_511:event:11437",
"source": "central.echo6.co",
"type": "central.incident.itd_511.v1",
"time": "2026-06-28T03:19:30+00:00",
"datacontenttype": "application/json",
"centralschemaversion": "1.0",
"centralcategory": "incident.itd_511",
"centralseverity": 1,
"specversion": "1.0",
"data": {
"id": "idaho_511:event:11437",
"adapter": "itd_511",
"category": "incident.itd_511",
"time": "2026-06-28T03:19:30Z",
"expires": null,
"severity": 1,
"geo": {
"centroid": [
-116.512966047015,
43.5991939125997
],
"bbox": null,
"regions": [
"US-ID"
],
"primary_region": "US-ID",
"geometry": {
"type": "Point",
"coordinates": [
-116.512966047015,
43.5991939125997
]
}
},
"data": {
"event_type_short": "incident",
"event_sub_type": "crash",
"roadway_name": "I-84",
"direction": "East",
"description": "Crash on I-84 Eastbound near Ada Canyon County Line. 1 Right lane blocked.",
"lanes_affected": "1 Right lane blocked",
"is_full_closure": false,
"itd_severity": "None",
"comment": "The rightmost lane of I-84 eastbound is blocked near Garrity Blvd., or milepost 38. Keep left and use caution.",
"cause": "Incident",
"organization": "ERS",
"recurrence_text": null,
"recurrence_schedules": [],
"restrictions": {
"Width": null,
"Height": null,
"Length": null,
"Weight": null,
"Speed": null
},
"detour_polyline": null,
"detour_instructions": null,
"encoded_polyline": null,
"id_internal": 37336,
"source_id": "11437",
"reported_epoch": 1782616680,
"last_updated_epoch": 1782616770,
"start_epoch": 1782616680,
"planned_end_epoch": null,
"latitude": 43.5991939125997,
"longitude": -116.512966047015,
"_enriched": {
"mile_marker": {
"value": 38.0,
"source": "comment_regex",
"confidence": "high"
},
"geocoder": {
"name": "Vietnam Veterans Memorial Highway",
"city": "Nampa",
"county": "Canyon",
"state": "Idaho",
"country": "United States",
"postal_code": "83687",
"timezone": "America/Boise",
"landclass": null,
"elevation_m": 778.296875
}
}
}
}
},
"subject": "central.traffic.incident.us.id",
"captured_epoch": 1783206527
}