Centralize D&D chunk prompt material preparation

This commit is contained in:
2026-07-21 14:27:39 +00:00
parent 3a8a82ebc9
commit 732b13669f
7 changed files with 149 additions and 70 deletions

View File

@@ -58,6 +58,13 @@ resolution and an ephemeral NPC registry before lane-specific material; the
NPC prompt appends its task and instructions. Stage contracts expose only
Notarius structured-completion types, not Scriptorium public types.
The shared `ChunkPromptMaterial` helper owns common transcript material
preparation for the spell, NPC, and combat-turn extractors. It clones supplied
source metadata, falls back to the materialized chunk when content is absent,
checks that content remains chunk-identical, and fills only the common default
fields. Extractors retain their request validation and wrap helper errors with
their module context.
Reference material may inform a module or prompt but must not become source
evidence. The resolver and materializer behavior is described in
[Pipeline Internals](pipeline.md#reference-materialization).