Files
weatherreporter/docs/internal/prepared-report.md

1.4 KiB

Prepared Report Internals

internal/app builds a preparedReport after collection and before profile execution. This is the immutable boundary shared by ordinary report generation and profile comparison; it is not a durable artifact.

Preparation first establishes one PreparedIdentity for the report run, report and prompt IDs, variant, generation time, units, timezone, valid period, location, and source warnings. It then builds report facts, the configured module snapshot, briefing metadata, the curated prompt-input package, serialized YAML, and the generated-text definition. The current metadata projections remain equivalent to that identity while each retains its own boundary-specific shape.

Preparation deep-copies mutable facts, snapshots, identity, metadata, and data-package bytes before returning them. Consumers receive independent copies so one execution cannot change another's input or rendering context.

Single-report generation executes one prepared profile and publishes its Markdown. Comparison prepares once, gives every selected profile the same YAML bytes, and only then assembles the resulting logical bundle. The prompt-input shape is owned by prompt-input internals; profile execution semantics are owned by Promptkit integration.

Preparation failure has no publication side effects. Tests for this boundary cover mutation isolation, byte equality, and reuse by both execution paths.