1.6 KiB
Prompt Input Internals
internal/promptinput turns prepared report metadata and an ordered module
snapshot into the YAML data package passed to Promptkit. The externally visible
prompt and inline-input contract is owned by the Promptkit integration
guide; preparation of the inputs is owned by
prepared report internals.
Package Construction
Build projects report identity, the report-local current date, source-warning
summaries, and each snapshot output's prompt-facing value into a package. It
does not expose source transport or provenance details. The module snapshot
defines stanza order and selects curated prompt values; the corresponding
module contracts are documented in module internals and briefing
internals.
MarshalYAML validates the package before serializing it. Serialization emits
the metadata stanza first, then groups the remaining recognized stanzas in the
package's fixed category order while preserving snapshot order within a
category. Validate enforces the supported schema version, required report
identity and period values, and a nonempty, complete ordered briefing.
This package does not collect weather, choose an output destination, execute a provider, or persist data packages. The application passes its in-memory YAML to the Promptkit adapter as part of prepared report execution.
Verification
Focused tests cover package construction, report-local dates, validation, curated snapshot exports, deterministic YAML grouping, and safe source-warning projection:
go test ./internal/promptinput