Clean up DnD shared prompt asset tests
This commit is contained in:
@@ -7,9 +7,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/llm"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/sharedassets/dnd"
|
||||
"gitea.maximumdirect.net/eric/scriptorium"
|
||||
)
|
||||
|
||||
@@ -52,49 +50,6 @@ func TestScriptoriumPromptPreparesWithMissingOptionalReferences(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestReferencePromptInputRenderingIsDeterministic(t *testing.T) {
|
||||
slot := contracts.ResolvedReferenceSlot{
|
||||
Items: []contracts.ReferenceItem{
|
||||
{
|
||||
SlotName: "roster",
|
||||
MediaType: "text/plain",
|
||||
Content: []byte("second"),
|
||||
Digest: "sha256:bbb",
|
||||
Origin: contracts.ReferenceOrigin{Type: "file", URI: "file:///b.txt"},
|
||||
SizeBytes: 6,
|
||||
},
|
||||
{
|
||||
SlotName: "roster",
|
||||
MediaType: "text/plain",
|
||||
Content: []byte("first"),
|
||||
Digest: "sha256:aaa",
|
||||
Origin: contracts.ReferenceOrigin{Type: "file", URI: "file:///a.txt"},
|
||||
SizeBytes: 5,
|
||||
},
|
||||
},
|
||||
}
|
||||
first := string(dnd.ReferencePromptInput(slot))
|
||||
second := string(dnd.ReferencePromptInput(slot))
|
||||
if first != second {
|
||||
t.Fatalf("reference rendering was not deterministic:\nfirst=%q\nsecond=%q", first, second)
|
||||
}
|
||||
if !strings.Contains(first, "Reference 1\nOrigin-Type: file\nOrigin-URI: file:///a.txt\nDigest: sha256:aaa") {
|
||||
t.Fatalf("first reference heading was not stable: %q", first)
|
||||
}
|
||||
if strings.Index(first, "first") > strings.Index(first, "second") {
|
||||
t.Fatalf("references were not sorted deterministically: %q", first)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSingleReferencePromptInputKeepsContentOnly(t *testing.T) {
|
||||
got := string(dnd.ReferencePromptInput(contracts.ResolvedReferenceSlot{
|
||||
Items: []contracts.ReferenceItem{{Content: []byte("single reference")}},
|
||||
}))
|
||||
if got != "single reference" {
|
||||
t.Fatalf("single reference rendering = %q, want raw content only", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScriptoriumPromptDiagnosticsOmitRawMaterials(t *testing.T) {
|
||||
transcript := []byte(`{"secret":"source text"}`)
|
||||
reference := "private party note"
|
||||
|
||||
Reference in New Issue
Block a user