Migrate NPC registry durable contract
This commit is contained in:
@@ -45,7 +45,7 @@ func referenceSlots() []contracts.ReferenceSlot {
|
||||
Description: "Required normalized NPC registry used only for interaction identity grounding, never as interaction evidence.",
|
||||
Required: true,
|
||||
AcceptedMediaTypes: []string{"application/json"},
|
||||
AcceptedArtifactKinds: []contracts.ArtifactKind{dnd.NPCListKind},
|
||||
AcceptedArtifactKinds: []contracts.ArtifactKind{dnd.NPCRegistryKind},
|
||||
MaxBytes: NPCRegistryMaxBytes,
|
||||
})
|
||||
sort.Slice(slots, func(i, j int) bool { return slots[i].Name < slots[j].Name })
|
||||
|
||||
@@ -181,7 +181,7 @@ func TestExtractResolvesGeneratedRegistryAtOperationTime(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestExtractAcceptsEmptyBoundRegistryAndEmptyResponse(t *testing.T) {
|
||||
content, err := npccodec.New().Encode(dnd.NPCList{NPCs: []dnd.NPC{}})
|
||||
content, err := npccodec.New().Encode(dnd.NPCRegistry{NPCs: []dnd.NPC{}})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -239,7 +239,7 @@ func TestModuleSpecRegistrationMetadataAndFingerprints(t *testing.T) {
|
||||
registrySlot = slot
|
||||
}
|
||||
}
|
||||
if !registrySlot.Required || !reflect.DeepEqual(registrySlot.AcceptedArtifactKinds, []contracts.ArtifactKind{dnd.NPCListKind}) || registrySlot.MaxBytes != NPCRegistryMaxBytes {
|
||||
if !registrySlot.Required || !reflect.DeepEqual(registrySlot.AcceptedArtifactKinds, []contracts.ArtifactKind{dnd.NPCRegistryKind}) || registrySlot.MaxBytes != NPCRegistryMaxBytes {
|
||||
t.Fatalf("NPC registry slot = %#v", registrySlot)
|
||||
}
|
||||
got.ReferenceSlots[0].AcceptedMediaTypes[0] = "changed"
|
||||
@@ -326,7 +326,7 @@ func requiredRegistryReferences(t *testing.T, names ...string) contracts.Referen
|
||||
SourceRefs: []source.SourceRef{{SourceID: "other-session", StartUnitID: index + 1, EndUnitID: index + 1}},
|
||||
}
|
||||
}
|
||||
content, err := npccodec.New().Encode(dnd.NPCList{NPCs: npcs})
|
||||
content, err := npccodec.New().Encode(dnd.NPCRegistry{NPCs: npcs})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user