Fix AI summary fire-status gap and NIFC perimeter sync#104
Merged
Conversation
The AI summary only read feed:fire:perimeters (NIFC), never the EONET fire entities that drive the UI fire card, so it reported a fire status gap while the dashboard showed active incidents. - summary: include entity:fire:* incidents (relevance, distance, last update) and AirNow AQI in the LLM context; label the NIFC perimeter feed as confirmed-empty vs never-synced - nifc: write an empty FeatureCollection on a successful zero-result query so consumers can distinguish no perimeters from a dead feed - nifc: uppercase entity names before stripping Wildfire/Fire suffixes so the targeted IncidentName query actually matches NIFC records - nifc: surface ArcGIS soft errors (HTTP 200 + error body) as fetch failures, escape quotes in the name query, narrow bare except https://claude.ai/code/session_01Tjq6r9HYsYY4g4BbUTQefG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The AI situational summary reported a fire STATUS GAP ("Current fire status data is unavailable") while the dashboard's Fire/Smoke Status card was simultaneously showing an active local fire alert (Haystack Butte) and a regional smoke watch.
Root cause: the UI card and the AI summary read from two completely separate pipelines. The card is fed by EONET
fire_incidententities (entity:fire:*), but the summary only readfeed:fire:perimetersfrom the NIFC poller — a key that is never written unless NIFC has successfully returned at least one perimeter since Redis last started.Changes
poller/pollers/summary.pyentity:fire:*entities — the same data the UI card shows (name, local-alert vs regional-watch relevance, distance, last update), sorted local-first.feed:weather:current).poller/pollers/nifc.pyFeatureCollectionon a successful zero-result query, so consumers can distinguish "no perimeters" from a dead feed.WILDFIRE/FIREsuffixes. Previously the case-sensitive replace did nothing on EONET title-case names, so the query searched for'HAYSTACK BUTTE WILDFIRE'and never matched NIFC'sIncidentNameofHaystack Butte.errorbody) as fetch failures instead of silently empty results.whereclause; narrows a bareexcept.Validation
python3 -m py_compilepasses on both modified files.https://claude.ai/code/session_01Tjq6r9HYsYY4g4BbUTQefG
Generated by Claude Code