Fingerprint D&D extractor mapping policies

This commit is contained in:
2026-07-24 14:23:35 +00:00
parent 1ff449435f
commit bef3d1359d
6 changed files with 43 additions and 1 deletions

View File

@@ -40,6 +40,12 @@ func TestNPCOutputGroundsSpellAndCombatConsumersThroughOneOperation(t *testing.T
if err != nil {
t.Fatalf("Prepare() error = %v", err)
}
for name, value := range map[string]string{
"extract:npcs:dnd/npcs:mapping_policy": "dnd.npcs.extract_mapping.v1",
"extract:spells:dnd/spells:mapping_policy": "dnd.spells.extract_mapping.v1",
} {
assertFingerprintValue(t, prepared.CheckpointFingerprints(), name, value)
}
for _, name := range []string{
"extract:npcs:dnd/npcs:prompt",
"extract:npcs:dnd/npcs:response_schema",
@@ -173,6 +179,16 @@ func TestNPCOutputGroundsSpellAndCombatConsumersThroughOneOperation(t *testing.T
assertCurrentEvidence(t, combatValue.CombatTurns[0].SourceRefs)
}
func assertFingerprintValue(t *testing.T, fingerprints []pipeline.CheckpointFingerprint, name, want string) {
t.Helper()
for _, fingerprint := range fingerprints {
if fingerprint.Name == name && fingerprint.Value == want {
return
}
}
t.Fatalf("fingerprints = %#v, want %q = %q", fingerprints, name, want)
}
func assertCurrentEvidence(t *testing.T, references []source.SourceRef) {
t.Helper()
for _, reference := range references {