Add daily generated text assets

This commit is contained in:
2026-06-15 16:23:13 +00:00
parent 4eece7cc8a
commit 3d452a120a
11 changed files with 528 additions and 20 deletions

View File

@@ -9,20 +9,21 @@ This document describes structured generated-text handling in
generated-text-template reports and builds curated render contexts for
templates. It also owns the generated-text catalog that connects report
definitions to validators, render-context builders, schema assets, and template
assets. The implemented contracts are Today Report, Tomorrow Report, and Hourly
Report.
assets. The implemented contracts are Daily validation and asset lookup, Today
Report, Tomorrow Report, and Hourly Report.
## Inputs And Outputs
Inputs:
- raw GeneratedText JSON for Today, Tomorrow Report, or Hourly Report
- raw GeneratedText JSON for Daily, Today, Tomorrow Report, or Hourly Report
- report metadata from `internal/briefing`
- a module snapshot from `internal/module`
- validated generated text
Outputs:
- typed `Daily` generated text
- typed `Today` generated text
- typed `Tomorrow` generated text
- typed `Hourly` generated text
@@ -33,6 +34,20 @@ Outputs:
- generated-text catalog handlers for report definitions that use
`generated_text_template`
The Daily generated text JSON accepts the same public fields and validation
rules as Tomorrow. Its catalog entry is selected through schema ID `daily` and
template ID `daily`; render-context construction is not implemented until the
Daily report context exists.
```json
{
"summary": "string",
"forecast_discussion": ["string"],
"precipitation_timing": "string",
"confidence": "string"
}
```
The hourly generated text JSON accepts:
```json
@@ -96,8 +111,8 @@ JSON when blank.
- Malformed generated-text JSON fails with decode context.
- Unknown generated-text JSON fields fail during decoding.
- Empty required fields fail after trimming whitespace.
- Today and Tomorrow forecast discussion fails when no nonblank paragraphs
remain.
- Daily, Today, and Tomorrow forecast discussion fails when no nonblank
paragraphs remain.
- Missing optional render-context stanzas become nil module pointers.
- Invalid render metadata, including missing timezone, missing generated time,
or invalid valid period, fails before template rendering.
@@ -109,6 +124,7 @@ JSON when blank.
Inspect:
- `internal/generatedtext/hourly_test.go`
- `internal/generatedtext/daily_test.go`
- `internal/generatedtext/today_test.go`
- `internal/generatedtext/tomorrow_test.go`
- `internal/generatedtext/catalog_test.go`