Add module contracts and registry validation

This commit is contained in:
2026-06-09 20:30:49 +00:00
parent e9508089ab
commit 24dba3bd60
11 changed files with 802 additions and 3 deletions

View File

@@ -21,6 +21,8 @@ Outputs:
- `briefing.Package` with common metadata and one report-specific content
object for Daily, 3-Day, Weekend, or Storm Report
- module registry definitions for known module IDs, stanza names, option
shapes, fact requirements, report compatibility, and missing-data behavior
- optional `currentConditions` prompt context from normalized
`/conditions/current` data when available
- optional structured `weatherStory` context on report-specific briefing
@@ -30,6 +32,8 @@ Outputs:
## Boundaries
- This package selects and shapes weather facts for prompts.
- It owns module registry validation, but app orchestration does not execute
modules yet.
- It does not fetch weather data, compare prior snapshots, build
`data_package` files, invoke Scriptorium, or write workflow metadata.
@@ -65,6 +69,10 @@ None. Builders either return a complete briefing package or an error.
least one derived summary.
- Storm briefing construction requires a Storm Report definition and forecast
bundle.
- Module registry construction rejects duplicate module IDs and duplicate
stanza names.
- Module composition validation rejects unknown modules, duplicate modules,
incompatible report/module combinations, and invalid typed options.
- Save failures include path and operation context.
## Tests
@@ -75,6 +83,7 @@ Inspect:
- `internal/briefing/three_day_test.go`
- `internal/briefing/weekend_test.go`
- `internal/briefing/storm_test.go`
- `internal/briefing/modules_test.go`
- `internal/app/app_test.go`
## Invariants