Construct prompt engines from shared configuration

This commit is contained in:
2026-11-23 04:23:59 +00:00
parent 1ca5011049
commit 9977cd9130
21 changed files with 153 additions and 253 deletions

View File

@@ -14,7 +14,7 @@ import (
"sync/atomic"
"testing"
"gitea.maximumdirect.net/eric/audita/v4/internal/core/config"
"gitea.maximumdirect.net/eric/audita/v4/internal/appconfig"
"gitea.maximumdirect.net/eric/audita/v4/internal/core/schema"
"gitea.maximumdirect.net/eric/audita/v4/internal/framework/llm"
ck "go.maximumdirect.net/configkit"
@@ -33,11 +33,11 @@ func TestMaintainedProjectsWithControlledProvider(t *testing.T) {
} {
t.Run(tc.dir+"/"+tc.main, func(t *testing.T) {
main := filepath.Join(root, tc.dir, tc.main)
loaded, err := config.Load(ck.Input{Source: ck.File(main)}, tc.overlay)
loaded, _, err := appconfig.Load(context.Background(), ck.Input{Source: ck.File(main)}, tc.overlay)
if err != nil {
t.Fatal(err)
}
loaded.Config.Reporting.Enabled = false
loaded.Config.Application.Reporting.Enabled = false
var calls atomic.Int32
var mu sync.Mutex
var models, prompts []string
@@ -83,7 +83,7 @@ func TestMaintainedProjectsWithControlledProvider(t *testing.T) {
if _, err := executePipeline(context.Background(), inputs, prepared, source.Canonical(), func(error) {}, nil); err != nil {
t.Fatal(err)
}
if int(calls.Load()) != len(loaded.Config.Pipeline.Stages) {
if int(calls.Load()) != len(loaded.Config.Application.Pipeline.Stages) {
t.Fatalf("provider calls=%d", calls.Load())
}
if tc.dir == "service" && (len(models) != 1 || models[0] != "example-testing-model") {
@@ -120,7 +120,7 @@ func TestExamplePromptEditIsCapturedOnNextLoad(t *testing.T) {
}
}
inspect := func() string {
loaded, err := config.Load(ck.Input{Source: ck.File(filepath.Join(dir, "config.yml"))}, "")
loaded, _, err := appconfig.Load(context.Background(), ck.Input{Source: ck.File(filepath.Join(dir, "config.yml"))}, "")
if err != nil {
t.Fatal(err)
}