feat(content): v0.5.8-state_511_atis -- central_normalizer with Photon nearest_town + composer bypass + SB->S route normalization

First per-adapter content formatter in the meshai-side central_normalizer library (per Central response to schema-divergence + nearest-town reports). state_511_atis (94% of Idaho 511 work-zone traffic) now produces clean wire strings like "🚧 SH-55, near McCall: both directions, emergency repairs" instead of the previous "🚧 ROADS: Work Zone, US-ID. routine -- roadwork".

Implementation: nearest_town(lat, lon) calls Photon directly at 100.64.0.24:2322/reverse with osm_tag=place + client-side filter for city/town/village/hamlet (Navi passthrough route documented in Central response does not exist on current Navi instance). H3-cell-7 LRU cache. Town fallback chain: _enriched.geocoder.city -> nearest_town(coords) -> drop segment. Composer bypass via event.data["_meshai_precomposed"] flag -- renderer owns full wire string for normalized events. SB->S route normalization. distance<1mi -> "near X".

Tests: 535 passed (was 511, +24 net). Synthetic probe over 25 bucket-B + 8 fixture envelopes confirmed 23/25 + 8/8 produce clean output; 2/25 fell back to None (drop segment) on Photon index gaps near Boise/Cascade. Matt eyeballed and approved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt Johnson 2026-06-04 21:38:40 +00:00
commit 7751a40c6c
15 changed files with 1801 additions and 0 deletions

View file

@ -0,0 +1,60 @@
{
"id": "ID:Construction:33930",
"source": "central.echo6.co",
"type": "central.work_zone.state_511_atis.v1",
"time": "2026-05-28T17:22:00+00:00",
"datacontenttype": "application/json",
"centralschemaversion": "1.0",
"centralcategory": "work_zone.state_511_atis",
"centralseverity": 1,
"specversion": "1.0",
"data": {
"id": "ID:Construction:33930",
"adapter": "state_511_atis",
"category": "work_zone.state_511_atis",
"time": "2026-05-28T17:22:00Z",
"expires": "2026-05-29T08:00:00Z",
"severity": 1,
"geo": {
"centroid": [
-116.09759,
44.9065083834611
],
"bbox": null,
"regions": [
"US-ID"
],
"primary_region": "US-ID",
"geometry": null
},
"data": {
"roadway_name": "SH-55",
"description": "Emergency repairs on SH-55 Both Directions near Washington St. 5/28/2026 5:00 PM to 5/29/2026 8:00 AM Thu, Fri: Active all day<div class='cellSpacer'><i><b>Comments:</b></i> Emergency fiber repair</div>",
"event_sub_type": "emergencyRepairs",
"direction": "Both",
"location_description": "Washington St",
"county": "Valley",
"state": "Idaho",
"start_date": "5/28/26, 5:00 PM",
"last_updated": "5/28/26, 5:22 PM",
"is_full_closure": false,
"layer": "Construction",
"state_code": "ID",
"latitude": 44.9065083834611,
"longitude": -116.09759,
"_enriched": {
"geocoder": {
"name": "Shell",
"city": "McCall",
"county": "Valley",
"state": "ID",
"country": "United States",
"postal_code": "83638",
"timezone": "America/Boise",
"landclass": null,
"elevation_m": 1537.4609375
}
}
}
}
}