Add 3-Day Outlook generation

This commit is contained in:
2026-05-29 18:08:50 +00:00
parent 19513e42c1
commit 4c9d396f9b
24 changed files with 927 additions and 78 deletions

View File

@@ -6,7 +6,7 @@ This document describes the implemented briefing package boundary.
`internal/briefing` builds structured report-specific briefing packages from
forecast summaries and report metadata. The package currently implements Daily
Today and Daily Tomorrow briefing content.
Today, Daily Tomorrow, and 3-Day Outlook briefing content.
## Inputs and Outputs
@@ -14,12 +14,13 @@ Inputs:
- resolved report definition and valid period
- forecast bundle
- derived daily forecast summary
- derived forecast summary or summaries
- configured units and timezone
Output:
- `briefing.Package` JSON containing common metadata and Daily briefing content
- `briefing.Package` JSON containing common metadata and report-specific
briefing content
## Boundaries
@@ -37,12 +38,18 @@ Output:
story context when available.
- Daily Tomorrow also includes planning inputs for morning readiness,
commute/school/workday concerns, and what may change overnight.
- 3-Day content includes one summary per local day or partial day, with overall
character, temperature range, precipitation, wind, risk, outdoor-window, and
alert inputs, plus broader discussion and weather-story context when
available.
- Briefing JSON is written atomically by `briefing.Save`.
## Failure Behavior
- Daily briefing construction requires a Daily report definition and a derived
daily forecast summary.
- 3-Day briefing construction requires a 3-Day report definition and at least
one derived daily summary in the outlook period.
- Save failures include path and operation context.
## Tests
@@ -50,6 +57,7 @@ Output:
Inspect:
- `internal/briefing/daily_test.go`
- `internal/briefing/three_day_test.go`
- `internal/app/app_test.go`
- `internal/cli/root_test.go`

View File

@@ -11,8 +11,8 @@ produces compact change records for prompt input data packages.
Inputs:
- prior Daily briefing package
- current Daily briefing package
- prior briefing package
- current briefing package
- configured Recent Changes thresholds
Output:
@@ -37,7 +37,7 @@ The app maps these config fields into comparison thresholds:
## Behavior
Daily comparison currently detects:
Daily and 3-Day comparison currently detect:
- temperature changes crossing configured thresholds
- precipitation probability and timing changes
@@ -47,17 +47,20 @@ Daily comparison currently detects:
When no prior comparable snapshot exists, the app sends an empty Recent Changes
section in the data package. Daily Today and Daily Tomorrow are compatible for
same-valid-date comparison through the report registry.
same-valid-date comparison through the report registry. 3-Day Outlook compares
with prior 3-Day Outlook snapshots for the same valid local date.
## Failure Behavior
Daily comparison requires both inputs to contain Daily briefing content.
Daily comparison requires both inputs to contain Daily briefing content. 3-Day
comparison requires both inputs to contain 3-Day briefing content.
## Tests
Inspect:
- `internal/changes/daily_test.go`
- `internal/changes/three_day_test.go`
- `internal/app/app_test.go`
## Invariants

View File

@@ -6,8 +6,8 @@ boundary.
## Purpose
`internal/forecast` converts a normalized forecast bundle into inspectable
daily daypart summaries. These summaries are structured data for later briefing
builders; they are not rendered report text.
daily and multi-day daypart summaries. These summaries are structured data for
later briefing builders; they are not rendered report text.
## Inputs and Outputs
@@ -15,6 +15,7 @@ Inputs:
- `forecast.Bundle`
- local date and timezone
- report period, for multi-day summaries
- configured daypart definitions with `HH:MM` start and end values
Output:
@@ -22,6 +23,8 @@ Output:
- `forecast.DailySummary` with a civil-day period, daypart summaries, selected
narrative periods, alert overlaps, discussion context, source warnings, and
source provenance.
- `forecast.BuildPeriodDailySummaries` output with one clipped daily summary
for each local day or partial day in a report period.
## Boundaries
@@ -41,6 +44,8 @@ Output:
- Alerts are selected by overlap with the daily period and each daypart.
- Narrative periods and discussion context are selected as broader source
context for later briefing builders.
- Multi-day period summaries clip the first and last local days to the resolved
report period before selecting hourly periods and alerts.
## Failure Behavior

View File

@@ -11,7 +11,7 @@ This document describes the implemented prompt input package boundary.
Input:
- `briefing.Package`
- `briefing.Package` containing Daily-family or 3-Day Outlook content
Output:

View File

@@ -5,7 +5,7 @@ This document describes the implemented filesystem state boundary.
## Purpose
`internal/state` owns durable artifact paths, atomic JSON writes, metadata, and
prior Daily snapshot lookup.
prior comparable snapshot lookup.
## Inputs and Outputs
@@ -25,8 +25,8 @@ Outputs:
- render preflight JSON
- Markdown report path
- metadata JSON
- prior Daily snapshot metadata when available
- prior Daily briefing package when loaded by path
- prior comparable snapshot metadata when available
- prior briefing package when loaded by path
## Boundaries
@@ -48,12 +48,13 @@ Workspace subdirectories must be relative paths that stay under
## State Behavior
Managed artifact names use RunID, which is generated from report generation time
and report ID. Daily metadata is stored beside Daily briefing snapshots by valid
local date. Prior Daily snapshot lookup reads metadata for the same valid local
date and returns the latest earlier compatible Daily Today or Daily Tomorrow
run. The store can load a briefing snapshot by path for structured comparison.
The store prepares the managed Markdown report path before `scriptorium run`
writes it.
and report ID. Metadata is stored beside briefing snapshots by report group and
valid local date. Prior snapshot lookup reads metadata for the same valid local
date and returns the latest earlier compatible run. Daily Today and Daily
Tomorrow are compatible with each other; 3-Day Outlook is compatible with prior
3-Day Outlook snapshots. The store can load a briefing snapshot by path for
structured comparison. The store prepares the managed Markdown report path
before `scriptorium run` writes it.
## Failure Behavior