Deterministic local-time normalization for all NWS/SPC timestamps #20

Closed
opened 2026-06-23 23:15:31 +00:00 by rbrooks · 2 comments
Owner

Target release: v1.3.0 (cross-cutting — could be pulled into v1.1.0)

Normalize all NWS/SPC timestamps to location-local time deterministically before they appear in LLM prompts or outbound messages. This benefits all notification paths, not just AI summaries, so it could be scheduled earlier if desired.

Source: docs/ROADMAP.md → Local LLM Alert Summarization → "Later phases".

**Target release:** v1.3.0 (cross-cutting — could be pulled into v1.1.0) Normalize all NWS/SPC timestamps to location-local time deterministically **before** they appear in LLM prompts or outbound messages. This benefits all notification paths, not just AI summaries, so it could be scheduled earlier if desired. Source: `docs/ROADMAP.md` → Local LLM Alert Summarization → "Later phases".
Contributor

Audit note (2026-07-18)

From the 2026-07 codebase audit (docs/.internal/report-2026-07-17.md), finding F-35.

This issue's body overstates the remaining work. Outbound-notification local-time normalization already shipped in May 2026 — format_location_datetime (app/services/time_formatting.py) is used across all notifiers and templates (grep: 15 files; commits e527b71, 42dea36 completed the notification-path normalization audit).

Remaining scope is narrower: guarantee normalization inside the LLM prompt context (app/services/ai_context.py) and any remaining raw-Z timestamps in structured metadata. Re-scope this issue before pulling it into a milestone; consider re-labeling to area:ai only (it currently also carries area:notifications, which the shipped work already covers).

## Audit note (2026-07-18) From the 2026-07 codebase audit (`docs/.internal/report-2026-07-17.md`), finding **F-35**. This issue's body overstates the remaining work. Outbound-notification local-time normalization already shipped in May 2026 — `format_location_datetime` (`app/services/time_formatting.py`) is used across all notifiers and templates (grep: 15 files; commits `e527b71`, `42dea36` completed the notification-path normalization audit). **Remaining scope is narrower:** guarantee normalization inside the LLM prompt context (`app/services/ai_context.py`) and any remaining raw-`Z` timestamps in structured metadata. Re-scope this issue before pulling it into a milestone; consider re-labeling to `area:ai` only (it currently also carries `area:notifications`, which the shipped work already covers).
Contributor

Done in #104 (merged). Per the F-35 note, the notification-path normalization already shipped in May; the remaining gap was the AI prompt context. Audited ai_context.py: existing timestamps already route through normalize_timestamp (machine UTC + location-local), and the new radar/SPS fields are localized via format_location_datetime — no raw Z strings reach the model. A test asserts the correct local offset and absence of "UTC" wording.

Done in #104 (merged). Per the F-35 note, the notification-path normalization already shipped in May; the remaining gap was the AI prompt context. Audited `ai_context.py`: existing timestamps already route through `normalize_timestamp` (machine UTC + location-local), and the new radar/SPS fields are localized via `format_location_datetime` — no raw `Z` strings reach the model. A test asserts the correct local offset and absence of "UTC" wording.
Sign in to join this conversation.
No project
No assignees
2 participants
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#20
No description provided.