Add grounded NPC interaction extractor

This commit is contained in:
2026-07-23 13:26:27 +00:00
parent 61016671ab
commit 2b9d2eaeaa
15 changed files with 1149 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
package npcinteractions
import (
"encoding/json"
"testing"
)
func TestExtractionResponsePreservesValidatorOwnedSemantics(t *testing.T) {
content := []byte(`{"interactions":[{"name":"","kind":"unsupported","source_refs":[{"start_unit_id":0,"end_unit_id":-1}]}]}`)
var response extractionResponse
if err := json.Unmarshal(content, &response); err != nil {
t.Fatalf("json.Unmarshal() error = %v", err)
}
interaction := response.Interactions[0]
if interaction.Name != "" || interaction.Kind != "unsupported" || interaction.SourceRefs[0] != (interactionSourceRefResponse{StartUnitID: 0, EndUnitID: -1}) {
t.Fatalf("decoded response = %#v", interaction)
}
}