Preserve native validation failure details
This commit is contained in:
@@ -2,6 +2,8 @@ package semanticreconcile
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io/fs"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -116,12 +118,20 @@ func TestNativeStructuralFailureIsNotAReconciliationRetry(t *testing.T) {
|
||||
// A test-selected native budget gives a terminal result without depending on
|
||||
// the upstream default number of structural repair calls.
|
||||
zero := 0
|
||||
schemaBytes, err := fs.ReadFile(assets.FS(), "generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var schema any
|
||||
if err := json.Unmarshal(schemaBytes, &schema); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
request.Validation = &promptkit.OutputContractInput{
|
||||
Format: promptkit.FormatJSON, ValidationMode: promptkit.ValidationJSONSchema,
|
||||
SchemaPath: "generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json", RepairAttempts: &zero,
|
||||
Schema: schema, RepairAttempts: &zero,
|
||||
}
|
||||
result, err := engine.Run(context.Background(), request)
|
||||
if err == nil && (result == nil || result.Validation.Status != promptkit.ValidationFailed || result.Validation.IsValid) {
|
||||
if err != nil || result == nil || result.Validation.Status != promptkit.ValidationFailed || result.Validation.IsValid || len(result.Validation.Errors) == 0 {
|
||||
t.Fatalf("native structural failure lost: %#v %v", result, err)
|
||||
}
|
||||
if len(client.requests) != 1 {
|
||||
|
||||
Reference in New Issue
Block a user