From 0b271267a078236c59257ede22c7809aabedb401 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 2 Nov 2026 03:52:25 +0000 Subject: [PATCH] Update configuration source controls --- configuration_sources_test.go | 4 ++-- docs/roadmap/implementation.md | 7 +++++++ .../go-library/prepare/collections/support/collection.yaml | 3 ++- internal/configuration/prompts_test.go | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configuration_sources_test.go b/configuration_sources_test.go index c7b4d55..541fb61 100644 --- a/configuration_sources_test.go +++ b/configuration_sources_test.go @@ -37,7 +37,7 @@ func TestCollectionInputLoadsNativeImportsAndLaterOverride(t *testing.T) { directory := t.TempDir() mainPath := filepath.Join(directory, "collection.yaml") defaultsPath := filepath.Join(directory, "defaults.yaml") - if err := os.WriteFile(mainPath, []byte("configkit:\n imports:\n - path: defaults.yaml\n"), 0o600); err != nil { + if err := os.WriteFile(mainPath, []byte("config:\n imports:\n - path: defaults.yaml\n required: true\n"), 0o600); err != nil { t.Fatal(err) } if err := os.WriteFile(defaultsPath, []byte("prompts:\n greeting:\n version: imported\n messages:\n - role: user\n content: Hello\n output:\n format: text\n validation_mode: none\n"), 0o600); err != nil { @@ -65,7 +65,7 @@ func TestCollectionInputLoadsNativeImportsAndLaterOverride(t *testing.T) { func TestCollectionInputLoadsEmbeddedImportsAndLaterOverride(t *testing.T) { files := fstest.MapFS{ - "collection.yaml": {Data: []byte("configkit:\n imports:\n - path: defaults.yaml\n")}, + "collection.yaml": {Data: []byte("config:\n imports:\n - path: defaults.yaml\n required: true\n")}, "defaults.yaml": {Data: []byte("prompts:\n greeting:\n version: imported\n messages:\n - role: user\n content: Hello\n output:\n format: text\n validation_mode: none\n")}, } filesystem := configkit.NewFilesystem("embedded collection", files) diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 27c2e27..f1f8ba3 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -217,6 +217,13 @@ maintained example assets; application resource shape can still be transitional. Validation: use the existing source-helper/import tests when runnable; otherwise record remaining resource-shape dependencies. Leave source headers for Stage 3. +Completion: source-root import controls now use `config`, with the selected +file imports explicitly required. Reviewed source-evidence assertions and found +no obsolete API or main-layer spellings in use. Validation passed: the native +and embedded collection input tests, directory/filesystem source-helper tests, +and inherited imported-content test on Go 1.27.0; `git diff --check` passed. +Resource formats and headers remain for the following assignments. + ## Stage 3: Introduce Identified Record Shapes And Header Version 2 Scope: schema types and loader definition in `internal/configuration/load.go`. diff --git a/examples/go-library/prepare/collections/support/collection.yaml b/examples/go-library/prepare/collections/support/collection.yaml index 0b4d672..2452f38 100644 --- a/examples/go-library/prepare/collections/support/collection.yaml +++ b/examples/go-library/prepare/collections/support/collection.yaml @@ -1,5 +1,6 @@ version: "1" -configkit: +config: imports: - path: fragments/resources.yaml + required: true release_version: "1.4.0" diff --git a/internal/configuration/prompts_test.go b/internal/configuration/prompts_test.go index 34434d2..ad38447 100644 --- a/internal/configuration/prompts_test.go +++ b/internal/configuration/prompts_test.go @@ -16,7 +16,7 @@ import ( func TestLoadCapturesInheritedImportedContent(t *testing.T) { files := fstest.MapFS{ - "app/main.yaml": {Data: []byte("configkit:\n imports:\n - path: ../catalog/base.yaml\n - path: ../other/definition.yaml\ncollections:\n docs:\n prompts:\n child:\n extends: base\n")}, + "app/main.yaml": {Data: []byte("config:\n imports:\n - path: ../catalog/base.yaml\n required: true\n - path: ../other/definition.yaml\n required: true\ncollections:\n docs:\n prompts:\n child:\n extends: base\n")}, "catalog/base.yaml": {Data: []byte("collections:\n docs:\n release_version: r1\n prompts:\n base:\n version: \"v1\"\n messages:\n - role: ' USER '\n cache_control:\n type: ' ephemeral '\n ttl: ' 1h '\n content_file: ./body.md\n output:\n format: text\n validation_mode: basic\n")}, "catalog/body.md": {Data: []byte("Captured {{.name}}")}, "other/definition.yaml": {Data: []byte("collections:\n other:\n prompts:\n child:\n messages:\n - role: user\n content_file: ./body.md\n output:\n format: text\n validation_mode: none\n")},