Files
weatherreporter/docs/internal/report-registry.md

1.9 KiB

Report Registry Internals

This document describes the implemented report identity and valid-period boundary.

Purpose

internal/report centralizes report IDs, prompt IDs, comparison strategies, valid-period resolution, report metadata, and scheduled batch membership.

Inputs and Outputs

Inputs:

  • report ID or batch name
  • generation time
  • configured timezone
  • optional Daily date override
  • optional manual storm start and end times

Outputs:

  • report.Resolved values with definition metadata and half-open valid periods
  • report.Metadata values suitable for later persisted run metadata

Boundaries

  • This package defines report identity and time coverage only.
  • It does not fetch weather data, build briefings, compare snapshots, write state, or call scriptorium.

Behavior

  • Daily Today covers one configured local civil day.
  • Daily Tomorrow covers the next configured local civil day.
  • 3-Day Outlook covers generation time through local midnight after the second following local civil day.
  • Weekend Outlook covers Saturday 00:00 to Monday 00:00 Monday through Thursday; Friday and Saturday cover the remaining weekend from Friday 18:00 or generation time, whichever is later.
  • Manual Storm Report uses explicit start and end times.
  • Morning batch resolves Daily Today and 3-Day Outlook, plus Weekend Outlook except on Sunday.
  • Evening batch resolves Daily Tomorrow.

Failure Behavior

  • Unknown report and batch names return actionable errors.
  • Sunday Weekend Outlook resolution returns an error.
  • Storm windows require start and end, with end after start.

Tests

Inspect:

  • internal/report/period_test.go
  • internal/app/app_test.go

Invariants

  • Report selection goes through the registry.
  • Valid periods are independent of rendered report text.
  • Prompt IDs and comparison strategies are declared with report definitions.