Document D&D prompt cache ordering

This commit is contained in:
2026-07-27 20:16:11 +00:00
parent d1eaec4dad
commit de8ed41b34
2 changed files with 40 additions and 15 deletions

View File

@@ -76,19 +76,22 @@ contract. Durable formats and compatibility rules remain in the
## Prompt Maintenance And Backend Caching
Prompt message order and shared asset bytes are runtime behavior. Backend cache
reuse depends on the same preceding messages and content, not merely equivalent
meaning. Keep reusable shared assets byte-identical and keep stable material
before the inputs that vary per request wherever a prompts declared sequence
supports caching. Preserve the existing manifest order and cache-control hints
when editing a prompt.
reuse depends on identical preceding roles, rendered bytes, and cache-control
metadata—not merely equivalent meaning. Keep reusable shared assets
byte-identical and preserve each prompts declared ordering and cache controls
when editing it.
D&D extraction manifests place the changing chunk transcript at the end of the
prompt after their reusable context. Scene chunking and NPC normalization use
their own declared message sequences because their inputs and work differ. The
family-specific asset and ordering rules belong in [D&D Module Internals](dnd.md).
Do not add tests that enforce a fixed message-prefix length; prompt-asset tests
should instead verify the meaningful asset sequence, inputs, and cache controls
of the prompt being changed.
For sibling prompts that can reuse the same source material, order universal
shared context first, request source material next, and module-specific
suffixes last. Put a cache boundary at a reusable prefix that is useful to the
backend. Redundant intermediate cache boundaries do not extend that reusable
prefix and add no value.
Prompt-family owners may choose a different sequence when their inputs and
reuse pattern differ. The D&D familys extraction, scene-chunking, and NPC
normalization policies are maintained in [D&D Module Internals](dnd.md#prompt-construction).
Do not add tests that enforce prompt prose; prompt tests should verify the
meaningful input placement and cache controls of the prompt being changed.
## Validation, Repair, And Retries