Bind schema selections throughout execution

This commit is contained in:
2026-11-20 15:36:44 +00:00
parent 2d96dfa696
commit 6fbbaa9cfa
20 changed files with 218 additions and 66 deletions

View File

@@ -13,6 +13,7 @@ import (
"strings"
"sync"
"testing"
"testing/fstest"
"text/template"
"time"
@@ -246,7 +247,8 @@ type fakeValidator struct {
validateCalls int
}
func (f *fakeValidator) PrepareValidation(_ context.Context, contract domain.OutputContract) (validate.PreparedValidation, error) {
func (f *fakeValidator) PrepareValidation(_ context.Context, input validate.Input) (validate.PreparedValidation, error) {
contract := input.Contract
var schemaDocument any
if contract.ValidationMode == domain.ValidationJSONSchema {
f.schemaLoads++
@@ -2519,7 +2521,7 @@ func TestRunnerSchedulesInitialAndRepairGenerationThroughOneBackendPool(t *testi
staticArtifactReader{},
staticRenderer{},
scheduledClient,
validate.NewStandardValidator("."),
validate.NewValidator(),
NewDefaultOutputRepairer(scheduledClient),
admitter,
)
@@ -2614,6 +2616,7 @@ func promptDef(format domain.OutputFormat, mode domain.ValidationMode, attempts
DefaultProfile: "exec",
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
Templates: []domain.PromptMessageTemplate{{Role: "user", Content: "x"}},
SchemaRoot: &domain.ResourceBinding{FS: fstest.MapFS{}, Path: "."},
Validation: domain.OutputContract{
ValidationMode: mode,
RepairAttempts: attempts,