Fix correlation over-merge, thin-call hallucination, and geocoding accuracy

- Cap unit-continuity path at 20 min idle (unit_continuity_max_idle_minutes)
- Block time_fallback and unit-continuity matching on reassignment calls
- Expand reassignment detection to cover unit-initiated self-reassignment
- Skip GPT extraction entirely for transcripts ≤5 words (prevents hallucinated tags/units)
- Reduce geocode_max_km from 75 to 40 to reject far-out-of-area results
- Include county in geocoding query for tighter jurisdiction anchoring
This commit is contained in:
Logan
2026-05-26 02:20:15 -04:00
parent 5eed4e08ce
commit f774be12b8
4 changed files with 60 additions and 22 deletions
+6 -2
View File
@@ -112,7 +112,8 @@ async def _run_extraction_pipeline(
all_tags.extend(scene["tags"])
# When dispatch is pulling a unit to a NEW call (reassignment), suppress unit
# overlap so the new scene doesn't chain into the unit's previous incident.
corr_units = [] if scene.get("reassignment") else scene.get("units")
is_reassignment = bool(scene.get("reassignment"))
corr_units = [] if is_reassignment else scene.get("units")
incident_id = await incident_correlator.correlate_call(
call_id=call_id,
node_id=node_id,
@@ -126,6 +127,7 @@ async def _run_extraction_pipeline(
units=corr_units,
vehicles=scene.get("vehicles"),
cleared_units=scene.get("cleared_units"),
reassignment=is_reassignment,
)
if incident_id and incident_id not in incident_ids:
incident_ids.append(incident_id)
@@ -213,7 +215,8 @@ async def _run_intelligence_pipeline(
if flags["correlation_enabled"]:
for scene in scenes:
all_tags.extend(scene["tags"])
corr_units = [] if scene.get("reassignment") else scene.get("units")
is_reassignment = bool(scene.get("reassignment"))
corr_units = [] if is_reassignment else scene.get("units")
incident_id = await incident_correlator.correlate_call(
call_id=call_id,
node_id=node_id,
@@ -227,6 +230,7 @@ async def _run_intelligence_pipeline(
units=corr_units,
vehicles=scene.get("vehicles"),
cleared_units=scene.get("cleared_units"),
reassignment=is_reassignment,
)
if incident_id and incident_id not in incident_ids:
incident_ids.append(incident_id)