Extract shared D&D combat policy
This commit is contained in:
@@ -24,6 +24,7 @@ var promptAssetManifest = shared.PromptAssetManifest{
|
||||
"common-dnd-identity.md",
|
||||
"common-dnd-references.md",
|
||||
"common-dnd-transcript-chunk.md",
|
||||
"common-dnd-scene-combat-policy.md",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,23 @@ func TestRegisterPromptAssetsPreparesSceneDescriptionPrompt(t *testing.T) {
|
||||
if prepared.PromptID != PromptID || prepared.OutputContract.SchemaPath != "dnd_scene_descriptions_llm.v1.json" {
|
||||
t.Fatalf("prepared prompt = %#v, want scene-description prompt identity and schema wiring", prepared)
|
||||
}
|
||||
const combatPolicySentinel = "substantive active combat materially organizes the"
|
||||
transcriptIndex := -1
|
||||
policyIndex := -1
|
||||
instructionsIndex := len(prepared.Messages) - 1
|
||||
policyOccurrences := 0
|
||||
for index, message := range prepared.Messages {
|
||||
if strings.Contains(message.Content, "scene-description-transcript") {
|
||||
transcriptIndex = index
|
||||
}
|
||||
if count := strings.Count(message.Content, combatPolicySentinel); count > 0 {
|
||||
policyIndex = index
|
||||
policyOccurrences += count
|
||||
}
|
||||
}
|
||||
if policyOccurrences != 1 || policyIndex <= transcriptIndex || policyIndex >= instructionsIndex {
|
||||
t.Fatalf("combat policy appeared %d times at message %d; want once after transcript message %d and before instructions message %d", policyOccurrences, policyIndex, transcriptIndex, instructionsIndex)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPromptMetadataAndDiagnosticsDoNotContainRawAssets(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user