Document Promptkit report generation

This commit is contained in:
2026-07-31 05:03:02 +00:00
parent 2c68d0a85f
commit b96f40e5ca
39 changed files with 256 additions and 1741 deletions

View File

@@ -1,22 +1,21 @@
# Report Template Internals
`internal/reporttemplate` embeds and renders the repository's native Markdown
templates and exposes their companion generated-text schemas. The current asset
IDs are `daily`, `today`, `tomorrow`, and `hourly`. The template files, partials,
and complete render-context field reference are maintained in
templates. The current template IDs are `daily`, `today`, `tomorrow`, and
`hourly`. The template files, partials, and complete render-context field
reference are maintained in
[report templates](../templates.md).
## Assets and lookup
The package embeds top-level templates, shared partials, and JSON schemas from
its asset directories. `Template` and `Schema` return the requested embedded
asset and fail with the requested ID when it is unknown or unreadable.
The package embeds top-level templates and shared partials. `Template` returns
the requested embedded template and fails with the requested ID when it is
unknown or unreadable.
Generated-text catalog handlers obtain schema bytes and template source through
these APIs. Prompt source files are repository assets for prompt registration;
they are not reporttemplate lookup assets. Report definitions select IDs, while
[generated-text internals](generatedtext.md) verifies the supported
schema/template pairing.
Generated-text schemas and Promptkit definitions are owned by
`internal/promptassets`; report-template owns Markdown source only. Report
definitions select IDs, while [generated-text internals](generatedtext.md)
verifies the supported schema/template pairing.
## Rendering
@@ -36,16 +35,17 @@ validation.
This package does not collect weather data, build modules, validate generated
text, construct contexts, resolve report definitions, write state, execute
Scriptorium, or upload reports. It produces Markdown bytes for application
Promptkit, or upload reports. It produces Markdown bytes for application
orchestration to persist.
Focused tests cover asset lookup, schema availability, rendering, partial
Focused tests cover template lookup, rendering, partial
behavior, missing keys, and malformed context:
```sh
go test ./internal/reporttemplate
```
Embedded assets stay as separate files, shared fragments stay under the partial
directory, and generated-text schemas describe prose slots rather than
deterministic weather facts.
Embedded templates stay as separate files and shared fragments stay under the
partial directory. Generated-text schemas are embedded separately by
`internal/promptassets` and describe prose slots rather than deterministic
weather facts.