Reorder shared D&D extraction prompt messages

This commit is contained in:
2026-07-21 14:22:46 +00:00
parent 1c9819f08e
commit 3a8a82ebc9
18 changed files with 147 additions and 99 deletions

View File

@@ -98,6 +98,18 @@ D&D prompt content. `internal/framework/promptfs` provides the domain-neutral
filesystem composition helper used to combine module-owned files with shared
domain prompt fragments.
The D&D spell, NPC, and combat-turn extractors each declare an ordered prompt
asset manifest. The manifest lists the package-owned YAML and Markdown files,
then the exact shared fragments rendered by that prompt; the same ordered list
drives both filesystem mounting and the prompt fingerprint. Shared extraction
evidence and in-world identity messages precede the cacheable transcript and
campaign-reference messages. Spell and combat prompts then render immediate
resolution and the cacheable NPC registry before their lane-specific material;
the NPC prompt renders its task and instructions instead. The identity,
transcript, and campaign-reference messages are ephemeral in all three prompts,
and the NPC registry is ephemeral where it is used by spell and combat prompts.
Unused shared assets are neither mounted nor fingerprinted.
Schema helpers load embedded JSON Schema with identity and digest metadata,
return defensive copies, and expose a diagnostics map that omits schema bytes.
The small framework registry contains only generic test schemas; production
@@ -113,8 +125,8 @@ input and an optional `application/json` `npcs` input. The extractor generates
the catalog input from its prepared
effective catalog as `{"spell_names":[...]}` using sorted canonical names only.
The shared D&D prompt assets include a generic NPC grounding fragment directly
after the campaign reference message for both extractors. When an NPC registry
is bound, the
after the campaign reference message for spell and combat prompts. When an NPC
registry is bound, the
domain registry boundary strictly decodes and identity-validates one durable
artifact, re-encodes canonical JSON, and generates a semantic digest over
those bytes. The unbound input is exactly `{"npcs":[]}`. Input digests cover