chore(autoresearch): log iter 18

This commit is contained in:
ryan
2026-08-29 09:12:03 +08:00
parent 8c4955c835
commit 020ebebfaa
2 changed files with 29 additions and 1 deletions
@@ -2145,11 +2145,38 @@ import (
"time"
"github.com/google/go-cmp/cmp"
"github.com/spf13/viper"
"Wavelet/core/extpoints"
"Wavelet/plugins/infra/config"
)
// yamlSource is a test-local core.ConfigSource over the repository config file.
// It deliberately does not import plugins/infra/config: backend/pkg must not depend on
// upper layers even in tests, and the adapter has its own coverage in its package tests.
type yamlSource struct {
v *viper.Viper
}
func newYAMLSource(t *testing.T, path string) *yamlSource {
t.Helper()
v := viper.New()
v.SetConfigFile(path)
require.NoError(t, v.ReadInConfig())
return &yamlSource{v: v}
}
func (s *yamlSource) Lookup(path string) (any, bool) {
if !s.v.IsSet(path) {
return nil, false
}
return s.v.Get(path), true
}
func (s *yamlSource) LookupEnv(name string) (string, bool) { return os.LookupEnv(name) }
func (s *yamlSource) Describe() string { return s.v.ConfigFileUsed() }
// engineAppConfig mirrors appConfig with engine tags.
type engineAppConfig struct {
AppName string `config:"app_name" env:"APP_NAME"`