AI structured context should report feed staleness, not just failure counts #61
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#61
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
_freshness_status(app/services/ai_context.py:81-86) returns "ok" for anyfeed with zero failures and any historical success, regardless of age — a
silently-stalled feed is described as fresh in the LLM prompt context. Apply
the diagnostics staleness thresholds (
stale_after_secondspattern) tolast_success_atand emit "stale" as a distinct status; ensure prompts andvalidators treat stale context conservatively.
Acceptance criteria:
Filed from the 2026-07-17 codebase audit (
docs/.internal/report-2026-07-17.md), finding F-22.Done in #104 (merged).
_freshness_statusnow returns a distinctstalestatus when a feed has zero failures but itslast_success_atis older than the category threshold (mirroring the diagnostics thresholds — nws_alerts 15m, spc_fetch 30m, forecasts 3h, etc.), plus per-entryage_seconds/stale_after_seconds. So a silently-stalled feed is reported to the LLM as stale rather than fresh; thefreshnessfield is already whitelisted for cloud, so both local and cloud prompts get the signal. Tests cover ok/stale/failing/unknown boundaries.