37 lines
1.6 KiB
Markdown
37 lines
1.6 KiB
Markdown
# 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](../integrations/promptkit.md); preparation of the inputs is owned by
|
|
[prepared report internals](prepared-report.md).
|
|
|
|
## 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](module.md) and [briefing
|
|
internals](briefing.md).
|
|
|
|
`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:
|
|
|
|
```sh
|
|
go test ./internal/promptinput
|
|
```
|