Clean up and normalize prompt output modules

This commit is contained in:
2026-06-12 12:00:40 -05:00
parent c3a051d372
commit e6a4bb2d16
23 changed files with 456 additions and 158 deletions

View File

@@ -64,13 +64,18 @@ subset of discussion fields.
`spc_convective_outlooks` uses collected SPC run metadata and derived
report-period outlooks. It emits `checked: true` for a successfully fetched
empty run, reports `outlook_count`, and includes prompt-facing outlook fields
such as risk label, severity rank, valid times, source URL, image URL, and
whether the outlook contains the configured location. It does not emit GeoJSON
geometry.
such as risk label, `period_begins`, `period_ends`, image URL, and whether the
outlook contains the configured location. It does not emit GeoJSON geometry,
source URL, expiration time, or severity rank.
Prompt-facing module intervals use friendly local `period_begins` and
`period_ends` labels. Canonical report metadata, source provenance,
`issued_at`, `updated_at`, and point-in-time fields remain separate.
`spc_convective_discussion` uses the same derived report-period outlooks and
discussion records. It is omitted unless at least one retained outlook has
severity rank `3` or higher and matching discussion text exists.
discussion records. It is omitted unless at least one retained categorical
outlook for the same SPC day has severity rank `3` or higher and matching
discussion text exists.
## External Adapters Used

View File

@@ -78,14 +78,17 @@ validation.
- `outlooks`
Each outlook entry may include `day`, `outlook_type`, `label`, `label_text`,
`severity_rank`, `valid_start`, `valid_end`, `issued_at`, `expires_at`,
`contains_location`, `source_url`, and `image_url`. It omits GeoJSON geometry.
`period_begins`, `period_ends`, `issued_at`, `contains_location`, and
`image_url`. It omits GeoJSON geometry, source URL, expiration time, and
severity rank.
`spc_convective_discussion` emits a narrative stanza only when a retained
report-period outlook has severity rank `3` or higher and matching discussion
text is available. Its output includes `included_because` and `discussions`;
each discussion may include `day`, `headline`, `summary`, `discussion`, and
`updated_at`.
report-period categorical outlook has severity rank `3` or higher and matching
discussion text is available. Its output includes `included_because` and
`discussions`; each discussion may include `day`, `period_begins`,
`period_ends`, `headline`, `summary`, `discussion`, and `updated_at`.
Discussions are included only for SPC days whose retained categorical outlooks
meet the severity threshold.
## Boundaries

View File

@@ -64,6 +64,9 @@ weather module stanzas under prompt-facing categories. This grouping is a YAML
presentation concern only: module snapshots remain flat, and loaded
`promptinput.Package` values expose flat stanza names in `Briefing.Values`.
Within each category, stanza order follows the module snapshot output order.
Prompt-facing module intervals use local `period_begins` and `period_ends`
labels; canonical report metadata and source timestamps remain structured
timestamps where applicable.
Current categories are:

View File

@@ -42,7 +42,7 @@ plan.
- Do not depend on `/outlooks/convective/active` or
`/outlooks/convective/location` for initial behavior.
- Include SPC discussion text only when at least one retained report-period
outlook has `severity_rank >= 3`.
categorical outlook has `severity_rank >= 3`.
- Define the discussion threshold as an internal constant, initially `3`, not a
config field.
@@ -305,13 +305,10 @@ Implementation:
- `outlook_type`;
- `label`;
- `label_text`;
- `severity_rank`;
- `valid_start`;
- `valid_end`;
- `period_begins`;
- `period_ends`;
- `issued_at`;
- `expires_at`;
- `contains_location`;
- `source_url`;
- `image_url`.
- Use human-readable local time helpers consistent with current modules.
- Do not emit GeoJSON geometry.
@@ -359,22 +356,25 @@ Implementation:
- Define a package-private constant near the module, for example:
`defaultSPCConvectiveDiscussionMinimumSeverityRank = 3`.
- Build from derived retained outlooks and discussions.
- Include discussion text only when at least one retained outlook has
- Include discussion text only when at least one retained categorical outlook
has
`severityRank >= defaultSPCConvectiveDiscussionMinimumSeverityRank`.
- When the threshold is not met, return `nil` output so the stanza is omitted.
- When threshold is met, include discussions for retained outlook days with:
- `day`;
- `period_begins`;
- `period_ends`;
- `headline`;
- `summary`;
- `discussion`;
- `updated_at`.
- Include a concise reason field such as:
`included_because: "severity_rank >= 3"`.
`included_because: "categorical severity_rank >= 3"`.
Acceptance criteria:
- Slight Risk or higher retained outlooks include matching discussion records
when available.
- Slight Risk or higher retained categorical outlooks include matching
discussion records when available.
- Lower-risk retained outlooks still appear in `spc_convective_outlooks` but
do not emit `spc_convective_discussion`.
- Missing discussion text omits the stanza without failing report generation.
@@ -542,7 +542,8 @@ Manual review:
- Confirm no module builder performs Weather API calls.
- Confirm prompt YAML omits GeoJSON geometry.
- Confirm checked-empty outlook data is not represented as missing data.
- Confirm SPC discussion text appears only at severity rank `3` or higher.
- Confirm SPC discussion text appears only for categorical outlooks at severity
rank `3` or higher.
- Confirm public CLI syntax, output paths, distributor upload behavior, and
Scriptorium argv remain unchanged.

View File

@@ -57,8 +57,8 @@ Important response semantics:
- Place `spc_convective_outlooks` under `applicable_risk_products`.
- Place `spc_convective_discussion` under `narrative_products`, immediately
after `area_forecast_discussion` in report module order when both are present.
- Include SPC outlook discussion text only when at least one retained outlook
for the report valid period has `severity_rank >= 3`.
- Include SPC outlook discussion text only when at least one retained
categorical outlook for the report valid period has `severity_rank >= 3`.
- Define that threshold as an internal constant so it can be adjusted later
without searching through module code.
- Treat a non-null run with empty arrays as checked empty data, not missing
@@ -104,11 +104,9 @@ briefing:
outlook_type: categorical
label: SLGT
label_text: Slight Risk
severity_rank: 3
valid_start: "2026-06-12 at 8:00 AM"
valid_end: "2026-06-13 at 7:00 AM"
period_begins: "2026-06-12 at 8:00 AM"
period_ends: "2026-06-13 at 7:00 AM"
contains_location: true
source_url: "https://..."
image_url: "https://..."
```
@@ -119,9 +117,11 @@ briefing:
narrative_products:
area_forecast_discussion: {}
spc_convective_discussion:
included_because: "severity_rank >= 3"
included_because: "categorical severity_rank >= 3"
discussions:
- day: 1
period_begins: "2026-06-12 at 8:00 AM"
period_ends: "2026-06-13 at 7:00 AM"
headline: "Severe storms possible"
summary: "Scattered severe storms are possible."
discussion: "SPC discussion text."