Adopt PromptKit profile inheritance
This commit is contained in:
@@ -361,6 +361,29 @@ func TestEmbeddedProfilesAreCompleteAndInspectable(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmbeddedProfilesAreMinimalBaseAliases(t *testing.T) {
|
||||
wantBases := map[string]string{
|
||||
"weather-balanced.yml": "gemini-flash-latest",
|
||||
"weather-deep.yml": "claude-sonnet-latest",
|
||||
"weather-light.yml": "deepseek-4-flash",
|
||||
}
|
||||
for path, wantBase := range wantBases {
|
||||
t.Run(path, func(t *testing.T) {
|
||||
data, err := fs.ReadFile(promptassets.ProfileFS(), path)
|
||||
if err != nil {
|
||||
t.Fatalf("read profile: %v", err)
|
||||
}
|
||||
var definition map[string]string
|
||||
if err := yaml.Unmarshal(data, &definition); err != nil {
|
||||
t.Fatalf("unmarshal profile: %v", err)
|
||||
}
|
||||
if definition["id"] != strings.TrimSuffix(path, ".yml") || definition["base_profile"] != wantBase || len(definition) != 2 {
|
||||
t.Fatalf("profile definition = %#v, want only its id and base profile %q", definition, wantBase)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmbeddedProfilesExcludeUnsafeOrIncidentalSettings(t *testing.T) {
|
||||
forbidden := []string{"endpoint:", "api_key", "credential", "temperature:", "top_p:", "max_tokens:"}
|
||||
if err := fs.WalkDir(promptassets.ProfileFS(), ".", func(path string, entry fs.DirEntry, err error) error {
|
||||
|
||||
Reference in New Issue
Block a user