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

87 lines
No EOL
2.4 KiB
JSON

{
"envelope": {
"id": "idaho_511:event:11503",
"source": "central.echo6.co",
"type": "central.incident.itd_511.v1",
"time": "2026-07-04T18:24:09+00:00",
"datacontenttype": "application/json",
"centralschemaversion": "1.0",
"centralcategory": "incident.itd_511",
"centralseverity": 1,
"specversion": "1.0",
"data": {
"id": "idaho_511:event:11503",
"adapter": "itd_511",
"category": "incident.itd_511",
"time": "2026-07-04T18:24:09Z",
"expires": null,
"severity": 1,
"geo": {
"centroid": [
-115.925124696356,
43.7434489175347
],
"bbox": null,
"regions": [
"US-ID"
],
"primary_region": "US-ID",
"geometry": {
"type": "Point",
"coordinates": [
-115.925124696356,
43.7434489175347
]
}
},
"data": {
"event_type_short": "incident",
"event_sub_type": "roadwayBlocked",
"roadway_name": "SH-21",
"direction": "Both",
"description": "Roadway Blocked on SH-21 Both Directions near MM (31). Lane Blocked.",
"lanes_affected": "Lane Blocked",
"is_full_closure": false,
"itd_severity": "None",
"comment": null,
"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": 40654,
"source_id": "11503",
"reported_epoch": 1783189260,
"last_updated_epoch": 1783189449,
"start_epoch": 1783189260,
"planned_end_epoch": null,
"latitude": 43.7434489175347,
"longitude": -115.925124696356,
"_enriched": {
"geocoder": {
"name": null,
"city": "Boise",
"county": "Boise",
"state": "ID",
"country": "United States",
"postal_code": "83716",
"timezone": "America/Boise",
"landclass": "Boise National Forest",
"elevation_m": 1048.578125
}
}
}
}
},
"subject": "central.traffic.incident.us.id",
"captured_epoch": 1783206522
}