Compare recent changes from module snapshots
This commit is contained in:
@@ -4,26 +4,24 @@ This document describes prompt input data package construction.
|
||||
|
||||
## Purpose
|
||||
|
||||
`internal/promptinput` converts a structured briefing package and optional
|
||||
Recent Changes into the `data_package` JSON passed to Scriptorium prompts.
|
||||
`internal/promptinput` converts report metadata, module snapshots, and optional
|
||||
Recent Changes into the YAML `data_package` passed to Scriptorium prompts.
|
||||
|
||||
## Inputs And Outputs
|
||||
|
||||
Inputs:
|
||||
|
||||
- `briefing.Package`
|
||||
- report metadata
|
||||
- `module.Snapshot`
|
||||
- optional `[]changes.Change`
|
||||
|
||||
Outputs:
|
||||
|
||||
- `promptinput.Package` containing schema version, RunID, report metadata,
|
||||
briefing content, Recent Changes, and source warnings. Briefing content
|
||||
includes configured location context, current conditions when available,
|
||||
structured weather story context when available, discussion key messages, and
|
||||
short/long-term AFD narratives when the Weather API provides them.
|
||||
named briefing stanzas, Recent Changes, and source warnings.
|
||||
- report metadata includes `currentLocalDate`, the generation date formatted as
|
||||
`YYYY-MM-DD` in the effective report timezone.
|
||||
- optional JSON file written by `promptinput.Save`
|
||||
- optional YAML file written by `promptinput.Save`
|
||||
|
||||
## Boundaries
|
||||
|
||||
@@ -34,7 +32,8 @@ Outputs:
|
||||
## Config Fields Used
|
||||
|
||||
None directly. Config-derived values, including timezone and prompt location
|
||||
context, are already present in briefing metadata before this package runs.
|
||||
context, are already present in report metadata and module stanzas before this
|
||||
package runs.
|
||||
|
||||
## External Adapters Used
|
||||
|
||||
@@ -42,7 +41,7 @@ None.
|
||||
|
||||
## State Or Manifest Behavior
|
||||
|
||||
`promptinput.Save` writes JSON atomically. Managed workspace paths are owned by
|
||||
`promptinput.Save` writes YAML atomically. Managed workspace paths are owned by
|
||||
`internal/state`.
|
||||
|
||||
## Skip And Resume Behavior
|
||||
@@ -51,9 +50,9 @@ None. Recent Changes is always present as an `items` list and may be empty.
|
||||
|
||||
## Failure Behavior
|
||||
|
||||
Validation fails before render preflight when required top-level or briefing
|
||||
metadata fields are missing or inconsistent, or when no report content is
|
||||
present. Save failures include filesystem operation and path context.
|
||||
Validation fails before render preflight when required top-level fields are
|
||||
missing or inconsistent, or when no named briefing stanzas are present. Save
|
||||
failures include filesystem operation and path context.
|
||||
|
||||
## Tests
|
||||
|
||||
@@ -64,6 +63,6 @@ Inspect:
|
||||
|
||||
## Invariants
|
||||
|
||||
- Scriptorium receives structured `data_package` JSON.
|
||||
- Briefing metadata and top-level report metadata must agree.
|
||||
- Scriptorium receives structured `data_package` YAML.
|
||||
- Module stanza order is deterministic for generated snapshots.
|
||||
- Recent Changes are not inferred from rendered report text.
|
||||
|
||||
Reference in New Issue
Block a user