v1.3.0 Phase A: AI context enrichment #104

Merged
claude-bot merged 1 commit from feat/v1.3.0-phaseA-aicontext into main 2026-07-19 00:39:10 +00:00
Contributor

Enriches the structured context handed to the AI summarizer — input-only, no prompt/validator changes.

  • #61 / F-22 — feed staleness: _freshness_status now emits a distinct stale status when a feed has no failures but its last_success_at is older than the category threshold (previously always "ok"), so a silently-stalled feed is reported as stale to the model instead of fresh. Reaches both local and cloud prompts (the freshness field is already whitelisted).
  • #20 / F-35 — local-time normalization: the notification path already ships this; audited the AI context — existing timestamps already route through normalize_timestamp, and the new fields are localized via format_location_datetime (no raw Z).
  • #17 — SPS/SVS snippets: bounded (≤3 statements, ≤800 chars each), labeled as verbatim official excerpts, opt-in via AI_CONTEXT_INCLUDE_SEVERE_STATEMENTS (default off, since it adds a per-summary NWS fetch).
  • #18 — radar/precip freshness: a small factual "radar imagery last updated N min ago" field from the media freshness rows (DB-only, no imagery).

Note

The new SPS/SVS and radar fields reach local providers only (dropped by _filter_structured_context_for_cloud's whitelist) — consistent with the existing cloud-privacy posture (SPS/SVS carries geographic detail). The staleness change reaches cloud too.

Testing

Full suite green on the dev server: 644 passed (9 new tests covering staleness boundaries, local-time formatting, and SPS/SVS + radar bounding).

Closes #17, #18, #20, #61

🤖 Generated with Claude Code

Enriches the structured context handed to the AI summarizer — input-only, no prompt/validator changes. - **#61 / F-22 — feed staleness**: `_freshness_status` now emits a distinct **`stale`** status when a feed has no failures but its `last_success_at` is older than the category threshold (previously always `"ok"`), so a silently-stalled feed is reported as stale to the model instead of fresh. Reaches both local and cloud prompts (the `freshness` field is already whitelisted). - **#20 / F-35 — local-time normalization**: the notification path already ships this; audited the AI context — existing timestamps already route through `normalize_timestamp`, and the new fields are localized via `format_location_datetime` (no raw `Z`). - **#17 — SPS/SVS snippets**: bounded (≤3 statements, ≤800 chars each), labeled as verbatim official excerpts, opt-in via `AI_CONTEXT_INCLUDE_SEVERE_STATEMENTS` (default off, since it adds a per-summary NWS fetch). - **#18 — radar/precip freshness**: a small factual "radar imagery last updated N min ago" field from the media freshness rows (DB-only, no imagery). ## Note The new SPS/SVS and radar fields reach **local** providers only (dropped by `_filter_structured_context_for_cloud`'s whitelist) — consistent with the existing cloud-privacy posture (SPS/SVS carries geographic detail). The staleness change reaches cloud too. ## Testing Full suite green on the dev server: **644 passed** (9 new tests covering staleness boundaries, local-time formatting, and SPS/SVS + radar bounding). Closes #17, #18, #20, #61 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Enrich AI summary context: staleness, local time, SPS/SVS, radar freshness
All checks were successful
CI / test (pull_request) Successful in 4m3s
f9197cac5b
- Feed staleness (#61/F-22): _freshness_status now emits a distinct "stale" when a
  feed has no failures but last_success_at is older than its category threshold
  (previously "ok" regardless of age), so the LLM sees stale feeds as stale
  instead of fresh. Reaches cloud + local (freshness is already whitelisted).
- Local-time normalization (#20/F-35): the notification path already shipped;
  audited the AI context — existing timestamps already route through
  normalize_timestamp; new fields are localized via format_location_datetime.
- SPS/SVS snippets (#17): bounded (<=3, <=800 chars each), labeled verbatim
  official excerpts, opt-in via AI_CONTEXT_INCLUDE_SEVERE_STATEMENTS (default off).
- Radar/precip freshness (#18): a small factual "radar imagery last updated N min
  ago" field from the media freshness rows (DB-only, no imagery).

Additive input enrichment only — no prompt/validator logic changed. The new
SPS/SVS and radar fields reach local providers only (dropped by the cloud context
whitelist), consistent with the privacy posture.

Full suite green on the dev server: 644 passed.

Closes #17, #18, #20, #61

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
claude-bot deleted branch feat/v1.3.0-phaseA-aicontext 2026-07-19 00:39:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/WeatherBot!104
No description provided.