Align docs with module prompt packages

This commit is contained in:
2026-06-09 21:37:28 +00:00
parent 468197f7e0
commit 1af6169999
12 changed files with 55 additions and 32 deletions

View File

@@ -53,7 +53,7 @@ Timezone values may be IANA names, configured aliases such as `Chicago` and
### `location`
`location` is descriptive prompt context included in briefing metadata and
`location` is descriptive prompt context included in module metadata and
Scriptorium data packages. It does not select a Weather API endpoint or enable
multiple configured forecast locations.
@@ -143,7 +143,7 @@ stub source slots use the missing-source policy.
### `workspace`
- `root`: workspace root for managed artifacts. Default: `workspace`.
- `snapshots_dir`: briefing and metadata directory under `workspace.root`. Default: `snapshots`.
- `snapshots_dir`: module snapshot and metadata directory under `workspace.root`. Default: `snapshots`.
- `reports_dir`: managed Markdown report directory under `workspace.root`. Default: `reports`.
- `data_packages_dir`: prompt input package directory under `workspace.root`. Default: `data-packages`.
- `preflight_dir`: Scriptorium render output directory under `workspace.root`. Default: `preflight`.

View File

@@ -30,8 +30,9 @@ scriptorium run \
```
`weatherreporter` always passes prompt input as
`--input data_package=<path>`. The data package is structured JSON created by
`internal/promptinput`.
`--input data_package=<path>`. The data package is structured YAML created by
`internal/promptinput`; module snapshots remain separate JSON artifacts for
inspection and Recent Changes.
## Configured Arguments

View File

@@ -6,10 +6,10 @@ This document describes the implemented workflow coordinator in `internal/app`.
`internal/app` coordinates the top-level use cases after CLI parsing and config
loading are complete. It resolves report definitions, fetches weather data,
builds collected and derived facts, builds module snapshots and prompt-input artifacts,
invokes Scriptorium through the adapter boundary, optionally notifies
distributor through an app-owned notifier boundary, persists managed state, runs
batches, and reads existing artifacts for inspection.
builds collected and derived facts, builds module snapshots and prompt-input
artifacts, invokes Scriptorium through the adapter boundary, optionally
notifies distributor through an app-owned notifier boundary, persists managed
state, runs batches, and reads existing artifacts for inspection.
## Inputs And Outputs
@@ -32,8 +32,8 @@ Outputs:
- batch summaries with per-report status, artifact paths, error text, and
notification outcome when attempted
- saved Weather API bundle JSON for fetch workflows
- inspection JSON values for reports, metadata, module snapshots, data packages, prior
snapshots, and source provenance
- inspection JSON values for reports, metadata, module snapshots, data
packages, prior snapshots, and source provenance
## Boundaries
@@ -51,7 +51,7 @@ persisted metadata stay in `internal/state`.
## Config Fields Used
- `weather_api.*` for Weather API client construction and briefing metadata
- `weather_api.*` for Weather API client construction and module metadata
- `scriptorium.*` for renderer construction
- `workspace.*` for filesystem state
- `dayparts` for daily and outlook summarization
@@ -88,7 +88,8 @@ If render preflight returns both a result and an error, preflight JSON and
metadata are persisted before the error is returned. If Scriptorium report
generation returns an error after writing output, the managed report and
metadata remain inspectable. Notification is not attempted after Weather API,
module snapshot, prompt input, render, Scriptorium run, or metadata-save failures.
module snapshot, prompt input, render, Scriptorium run, or metadata-save
failures.
When notification is attempted, the debug artifact records request identity,
including rendered pipeline ID, bundle paths, accepted upload fields,
distributor status fields, raw status report JSON when available, and redacted
@@ -117,7 +118,8 @@ inspection view.
## Failure Behavior
- Resolve errors stop the requested workflow before fetching weather data.
- Weather API and briefing errors stop that report before Scriptorium runs.
- Weather API and module execution errors stop that report before Scriptorium
runs.
- Prompt input validation fails before render preflight.
- Render and run errors preserve Scriptorium stderr and exit-code context.
- Notification errors are wrapped with report ID, RunID, and managed report path

View File

@@ -1,6 +1,7 @@
# Briefing Internals
# Module Builder Internals
This document describes the implemented briefing package boundary.
This document describes the implemented module builder boundary in
`internal/briefing`.
## Purpose
@@ -38,7 +39,7 @@ Outputs:
## Config Fields Used
The package receives configured units and timezone from the app layer. Daypart
configuration is consumed by `internal/facts` before briefing builders run.
configuration is consumed by `internal/facts` before module builders run.
Configured `location` values are prompt context only; Weather API
`sourceLocationId` and `sourceLocation` remain source provenance.
Current conditions are copied from the normalized `/conditions/current` bundle

View File

@@ -6,7 +6,7 @@ This document describes the implemented fact contract boundary.
`internal/facts` separates normalized upstream facts collected for a report run
from conservative report-scoped facts derived from them. The package gives app
orchestration one place to build reusable facts before briefing construction.
orchestration one place to build reusable facts before module execution.
## Inputs And Outputs

View File

@@ -6,7 +6,7 @@ This document describes deterministic forecast summarization in
## Purpose
`internal/forecast` converts normalized weather data into daily and period
summaries used by fact builders and briefing builders.
summaries used by fact builders and module builders.
## Inputs And Outputs
@@ -48,7 +48,7 @@ None directly. Forecast data arrives through `weatherdata.Bundle`.
## State Or Manifest Behavior
None. Source warnings and provenance from the bundle are carried into summaries
for later metadata and briefing output.
for later metadata and module output.
## Skip And Resume Behavior

View File

@@ -6,7 +6,7 @@ This document describes the implemented module contract boundary.
`internal/module` defines stable module IDs, typed configuration items, module
outputs, and module snapshots. It is a shared contract imported by report
definitions and briefing registry code.
definitions and module registry code.
## Inputs And Outputs
@@ -25,7 +25,7 @@ Outputs:
## Boundaries
- This package owns shared module identifiers and output envelope contracts.
- It does not define report IDs, build briefing stanzas, fetch weather data,
- It does not define report IDs, build prompt stanzas, fetch weather data,
derive facts, write state, or invoke Scriptorium.
## State Or Manifest Behavior

View File

@@ -18,7 +18,7 @@ Inputs:
Outputs:
- `promptinput.Package` containing schema version, RunID, report metadata,
named briefing stanzas, Recent Changes, and source warnings.
named module stanzas under `briefing`, Recent Changes, and source warnings.
- report metadata includes `currentLocalDate`, the generation date formatted as
`YYYY-MM-DD` in the effective report timezone.
- optional YAML file written by `promptinput.Save`
@@ -51,7 +51,7 @@ None. Recent Changes is always present as an `items` list and may be empty.
## Failure Behavior
Validation fails before render preflight when required top-level fields are
missing or inconsistent, or when no named briefing stanzas are present. Save
missing or inconsistent, or when no named module stanzas are present. Save
failures include filesystem operation and path context.
## Tests

View File

@@ -15,7 +15,7 @@ from app and domain packages.
Inputs:
- prompt ID
- prompt input data package path
- YAML prompt input data package path
- report output path for `run`
- configured binary, config path, profile, timeout, and extra arguments
- context for cancellation
@@ -96,5 +96,6 @@ Inspect:
- No shell interpolation is used.
- The Scriptorium input name is `data_package`.
- The file at the data package path is YAML produced by `internal/promptinput`.
- Render and run preserve command-specific result structs.
- Scriptorium-specific flags stay inside adapter and config boundaries.

View File

@@ -97,9 +97,9 @@ notification is attempted and include rendered distributor pipeline ID, bundle
ID, idempotency key, bundle paths, upload status, latest run status, and
redacted errors.
Inspection helpers read existing metadata, module snapshot, and data package files.
Missing metadata directories return no inspection records or no prior snapshot
rather than creating state.
Inspection helpers read existing metadata, module snapshot, and data package
files. Missing metadata directories return no inspection records or no prior
snapshot rather than creating state.
## Failure Behavior