Protect operator schema files from output collisions

This commit is contained in:
2026-11-23 16:56:17 +00:00
parent fed190cc97
commit ac47c239c2
5 changed files with 103 additions and 16 deletions

View File

@@ -17,10 +17,12 @@ func TestRuntimeTracksCapturedConfigurationAndInheritedMessageFiles(t *testing.T
for name, content := range map[string]string{
"config.yml": "version: 3\n",
"prompts.yml": "config:\n imports:\n - path: catalog/arbitrary-name.yaml\n required: true\n",
"catalog/arbitrary-name.yaml": "prompts:\n - id: source\n messages:\n - role: user\n content_file: instruction.md\n output:\n format: text\n validation_mode: none\n",
"catalog/arbitrary-name.yaml": "prompts:\n - id: source\n messages:\n - role: user\n content_file: instruction.md\n output:\n format: json\n validation_mode: json_schema\n schema_file: schema.json\n",
"catalog/schema.json": "{}",
"prompts/shared/schema.json": "{}",
"catalog/instruction.md": "Captured operator message.\n",
"prompts/nested/override.yaml": "prompts:\n - id: literal-child\n extends: {id: source}\n",
"prompts/nested/collection.yml": "collections:\n operator:\n prompts:\n - id: local\n messages:\n - role: user\n content_file: ../shared/collection.md\n output:\n format: text\n validation_mode: none\n",
"prompts/nested/collection.yml": "collections:\n operator:\n prompts:\n - id: local\n messages:\n - role: user\n content_file: ../shared/collection.md\n output:\n format: json\n validation_mode: json_schema\n schema_file: ../shared/schema.json\n",
"prompts/shared/collection.md": "Message in a collection.\n",
} {
file := filepath.Join(dir, name)
@@ -44,6 +46,8 @@ func TestRuntimeTracksCapturedConfigurationAndInheritedMessageFiles(t *testing.T
filepath.Join(dir, "prompts.yml"),
filepath.Join(dir, "catalog/arbitrary-name.yaml"),
filepath.Join(dir, "catalog/instruction.md"),
filepath.Join(dir, "catalog/schema.json"),
filepath.Join(dir, "prompts/shared/schema.json"),
filepath.Join(dir, "prompts/nested/override.yaml"),
filepath.Join(dir, "prompts/nested/collection.yml"),
filepath.Join(dir, "prompts/shared/collection.md"),