Publish effective LLM backend provenance
This commit is contained in:
@@ -449,6 +449,46 @@ func TestEncodePrettyPrintsJSON(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEncodePublishesLLMProfileProvenance(t *testing.T) {
|
||||
result, err := New().Encode(context.Background(), contracts.OutputRequest{
|
||||
Manifest: artifacts.RunManifest{
|
||||
RunID: "run-1",
|
||||
LLMProfiles: []artifacts.LLMProfileManifest{
|
||||
{
|
||||
ID: "endpoint-profile",
|
||||
Provider: "promptkit",
|
||||
Model: "endpoint-model",
|
||||
ReasoningEffort: "low",
|
||||
},
|
||||
{
|
||||
ID: "profile",
|
||||
Provider: "promptkit",
|
||||
Model: "model",
|
||||
BackendID: "openrouter",
|
||||
ReasoningEffort: "high",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Encode() error = %v, want nil", err)
|
||||
}
|
||||
|
||||
manifest := decodeObject(t, fileBytes(t, result.Files, "manifest.json"))
|
||||
profiles := manifest["llm_profiles"].([]any)
|
||||
if len(profiles) != 2 {
|
||||
t.Fatalf("llm_profiles = %#v, want two entries", profiles)
|
||||
}
|
||||
endpointProfile := profiles[0].(map[string]any)
|
||||
if _, exists := endpointProfile["backend_id"]; exists || endpointProfile["reasoning_effort"] != "low" {
|
||||
t.Fatalf("endpoint-only LLM profile = %#v, want omitted backend and published reasoning", endpointProfile)
|
||||
}
|
||||
backendProfile := profiles[1].(map[string]any)
|
||||
if backendProfile["backend_id"] != "openrouter" || backendProfile["reasoning_effort"] != "high" {
|
||||
t.Fatalf("backend LLM profile = %#v, want published backend and reasoning fields", backendProfile)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEncodeIncludesManifestReferences(t *testing.T) {
|
||||
result, err := New().Encode(context.Background(), contracts.OutputRequest{
|
||||
Manifest: artifacts.RunManifest{
|
||||
|
||||
Reference in New Issue
Block a user