From 43a68e97ee36255d588844c710a9b0c3326f6933 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Sun, 4 Oct 2026 00:23:04 +0000 Subject: [PATCH] Migrate profile fixtures to keyed documents --- cmd/audita/main_integration_test.go | 2 +- docs/roadmap/implementation.md | 8 +++++++- examples/configkit-inheritance.yml | 1 + examples/minimal-config.yml | 1 + examples/production-config.yml | 1 + examples/profiles/local-proposal.yaml | 7 ------- examples/profiles/local-validation.yaml | 7 ------- examples/profiles/local/local-proposal.yaml | 8 ++++++++ examples/profiles/local/local-validation.yaml | 8 ++++++++ examples/profiles/service-proposal-testing.yaml | 7 ------- examples/profiles/service-proposal.yaml | 7 ------- examples/profiles/service-validation-testing.yaml | 7 ------- examples/profiles/service-validation.yaml | 7 ------- .../profiles/service/service-proposal-testing.yaml | 8 ++++++++ examples/profiles/service/service-proposal.yaml | 8 ++++++++ .../profiles/service/service-validation-testing.yaml | 8 ++++++++ examples/profiles/service/service-validation.yaml | 8 ++++++++ internal/framework/llm/adapter_capacity_test.go | 4 ++-- internal/framework/llm/adapter_test.go | 4 ++-- internal/framework/llm/runtime_inspection_test.go | 10 +++++----- .../proposal_generation/adapter_integration_test.go | 2 +- internal/framework/runner/cancellation_test.go | 2 +- internal/framework/validators/llm_integration_test.go | 2 +- 23 files changed, 71 insertions(+), 56 deletions(-) delete mode 100644 examples/profiles/local-proposal.yaml delete mode 100644 examples/profiles/local-validation.yaml create mode 100644 examples/profiles/local/local-proposal.yaml create mode 100644 examples/profiles/local/local-validation.yaml delete mode 100644 examples/profiles/service-proposal-testing.yaml delete mode 100644 examples/profiles/service-proposal.yaml delete mode 100644 examples/profiles/service-validation-testing.yaml delete mode 100644 examples/profiles/service-validation.yaml create mode 100644 examples/profiles/service/service-proposal-testing.yaml create mode 100644 examples/profiles/service/service-proposal.yaml create mode 100644 examples/profiles/service/service-validation-testing.yaml create mode 100644 examples/profiles/service/service-validation.yaml diff --git a/cmd/audita/main_integration_test.go b/cmd/audita/main_integration_test.go index cafd9cb..1566747 100644 --- a/cmd/audita/main_integration_test.go +++ b/cmd/audita/main_integration_test.go @@ -237,7 +237,7 @@ func newProcessFixture(t *testing.T, mode, modules string) processFixture { t.Fatal(err) } for _, id := range []string{"proposal", "validation"} { - profile := fmt.Sprintf("id: %s\nbackend: local\nmodel: local\ntimeout_seconds: 5\n", id) + profile := fmt.Sprintf("profiles:\n %s:\n backend: local\n model: local\n timeout_seconds: 5\n", id) if err := os.WriteFile(filepath.Join(dir, "profiles", id+".yaml"), []byte(profile), 0600); err != nil { t.Fatal(err) } diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 8a91bd4..5fe0e70 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -1,7 +1,7 @@ # Implementation Plan: PromptKit v0.12.0 Adoption **Last updated:** 2026-10-03 -**Status:** In progress; Stage 1 completed. +**Status:** In progress; Stages 1–2 completed. **Audience:** Luna coding agent. ## Scope and Execution @@ -148,6 +148,12 @@ selections, and changed fixture text; run `git diff --check` and format touched Go test files. These formats become consumable in Stage 3. Commit this unit. Current documentation links and recipes are updated together in Stage 8. +**Completion marker:** Stage 2 complete. Six maintained profile documents are +keyed and split into separately selected local/service roots; the listed Go +fixtures use keyed definitions. Touched Go files were formatted and +`git diff --check` passed. Runtime tests are deferred until Stage 3 replaces +the current consumer, as the plan allows intermediate commits not to run. + ## Stage 3 — Adopt the Released Source API and Selected-Role Checks **Primary files:** `go.mod`, `go.sum`, diff --git a/examples/configkit-inheritance.yml b/examples/configkit-inheritance.yml index 41a0d69..604b7d9 100644 --- a/examples/configkit-inheritance.yml +++ b/examples/configkit-inheritance.yml @@ -1,4 +1,5 @@ version: 2 +profiles_dir: profiles/local backends: local-base: endpoint: http://127.0.0.1:11434/v1 diff --git a/examples/minimal-config.yml b/examples/minimal-config.yml index 353e79e..2073c84 100644 --- a/examples/minimal-config.yml +++ b/examples/minimal-config.yml @@ -1,4 +1,5 @@ version: 2 +profiles_dir: profiles/local backends: local: endpoint: http://127.0.0.1:11434/v1 diff --git a/examples/production-config.yml b/examples/production-config.yml index 2e57be5..b200c4c 100644 --- a/examples/production-config.yml +++ b/examples/production-config.yml @@ -1,4 +1,5 @@ version: 2 +profiles_dir: profiles/service backends: service: endpoint: https://openrouter.ai/api/v1 diff --git a/examples/profiles/local-proposal.yaml b/examples/profiles/local-proposal.yaml deleted file mode 100644 index a2b627b..0000000 --- a/examples/profiles/local-proposal.yaml +++ /dev/null @@ -1,7 +0,0 @@ -id: local-proposal -backend: local -model: replace-with-local-model -temperature: 0 -max_tokens: 2048 -top_p: 1 -timeout_seconds: 120 diff --git a/examples/profiles/local-validation.yaml b/examples/profiles/local-validation.yaml deleted file mode 100644 index 695db87..0000000 --- a/examples/profiles/local-validation.yaml +++ /dev/null @@ -1,7 +0,0 @@ -id: local-validation -backend: local -model: replace-with-local-model -temperature: 0 -max_tokens: 1024 -top_p: 1 -timeout_seconds: 120 diff --git a/examples/profiles/local/local-proposal.yaml b/examples/profiles/local/local-proposal.yaml new file mode 100644 index 0000000..3a7b6cc --- /dev/null +++ b/examples/profiles/local/local-proposal.yaml @@ -0,0 +1,8 @@ +profiles: + local-proposal: + backend: local + model: replace-with-local-model + temperature: 0 + max_tokens: 2048 + top_p: 1 + timeout_seconds: 120 diff --git a/examples/profiles/local/local-validation.yaml b/examples/profiles/local/local-validation.yaml new file mode 100644 index 0000000..a6b5e75 --- /dev/null +++ b/examples/profiles/local/local-validation.yaml @@ -0,0 +1,8 @@ +profiles: + local-validation: + backend: local + model: replace-with-local-model + temperature: 0 + max_tokens: 1024 + top_p: 1 + timeout_seconds: 120 diff --git a/examples/profiles/service-proposal-testing.yaml b/examples/profiles/service-proposal-testing.yaml deleted file mode 100644 index 2966380..0000000 --- a/examples/profiles/service-proposal-testing.yaml +++ /dev/null @@ -1,7 +0,0 @@ -id: service-proposal-testing -backend: service -model: replace-with-testing-model -temperature: 0 -max_tokens: 2048 -top_p: 1 -timeout_seconds: 120 diff --git a/examples/profiles/service-proposal.yaml b/examples/profiles/service-proposal.yaml deleted file mode 100644 index b084c7f..0000000 --- a/examples/profiles/service-proposal.yaml +++ /dev/null @@ -1,7 +0,0 @@ -id: service-proposal -backend: service -model: replace-with-provider-model -temperature: 0 -max_tokens: 2048 -top_p: 1 -timeout_seconds: 120 diff --git a/examples/profiles/service-validation-testing.yaml b/examples/profiles/service-validation-testing.yaml deleted file mode 100644 index e817b24..0000000 --- a/examples/profiles/service-validation-testing.yaml +++ /dev/null @@ -1,7 +0,0 @@ -id: service-validation-testing -backend: service -model: replace-with-testing-model -temperature: 0 -max_tokens: 1024 -top_p: 1 -timeout_seconds: 120 diff --git a/examples/profiles/service-validation.yaml b/examples/profiles/service-validation.yaml deleted file mode 100644 index ccab858..0000000 --- a/examples/profiles/service-validation.yaml +++ /dev/null @@ -1,7 +0,0 @@ -id: service-validation -backend: service -model: replace-with-provider-model -temperature: 0 -max_tokens: 1024 -top_p: 1 -timeout_seconds: 120 diff --git a/examples/profiles/service/service-proposal-testing.yaml b/examples/profiles/service/service-proposal-testing.yaml new file mode 100644 index 0000000..fdbc56c --- /dev/null +++ b/examples/profiles/service/service-proposal-testing.yaml @@ -0,0 +1,8 @@ +profiles: + service-proposal-testing: + backend: service + model: replace-with-testing-model + temperature: 0 + max_tokens: 2048 + top_p: 1 + timeout_seconds: 120 diff --git a/examples/profiles/service/service-proposal.yaml b/examples/profiles/service/service-proposal.yaml new file mode 100644 index 0000000..ea4a949 --- /dev/null +++ b/examples/profiles/service/service-proposal.yaml @@ -0,0 +1,8 @@ +profiles: + service-proposal: + backend: service + model: replace-with-provider-model + temperature: 0 + max_tokens: 2048 + top_p: 1 + timeout_seconds: 120 diff --git a/examples/profiles/service/service-validation-testing.yaml b/examples/profiles/service/service-validation-testing.yaml new file mode 100644 index 0000000..bfd69dd --- /dev/null +++ b/examples/profiles/service/service-validation-testing.yaml @@ -0,0 +1,8 @@ +profiles: + service-validation-testing: + backend: service + model: replace-with-testing-model + temperature: 0 + max_tokens: 1024 + top_p: 1 + timeout_seconds: 120 diff --git a/examples/profiles/service/service-validation.yaml b/examples/profiles/service/service-validation.yaml new file mode 100644 index 0000000..3e1c741 --- /dev/null +++ b/examples/profiles/service/service-validation.yaml @@ -0,0 +1,8 @@ +profiles: + service-validation: + backend: service + model: replace-with-provider-model + temperature: 0 + max_tokens: 1024 + top_p: 1 + timeout_seconds: 120 diff --git a/internal/framework/llm/adapter_capacity_test.go b/internal/framework/llm/adapter_capacity_test.go index 69b4010..8e9c19e 100644 --- a/internal/framework/llm/adapter_capacity_test.go +++ b/internal/framework/llm/adapter_capacity_test.go @@ -46,7 +46,7 @@ func TestRolesShareBackendCapacityAndReleaseAfterCancellation(t *testing.T) { t.Fatal(err) } for _, name := range []string{"proposal", "validation"} { - profile := "id: " + name + "\nbackend: shared\nmodel: local\n" + profile := "profiles:\n " + name + ":\n backend: shared\n model: local\n" if err := os.WriteFile(filepath.Join(dir, "profiles", name+".yaml"), []byte(profile), 0600); err != nil { t.Fatal(err) } @@ -175,7 +175,7 @@ func TestDistinctBackendsHaveIndependentCapacity(t *testing.T) { t.Fatal(err) } for name, backend := range map[string]string{"proposal": "first", "validation": "second"} { - if err := os.WriteFile(filepath.Join(dir, "profiles", name+".yaml"), []byte("id: "+name+"\nbackend: "+backend+"\nmodel: local\n"), 0600); err != nil { + if err := os.WriteFile(filepath.Join(dir, "profiles", name+".yaml"), []byte("profiles:\n "+name+":\n backend: "+backend+"\n model: local\n"), 0600); err != nil { t.Fatal(err) } } diff --git a/internal/framework/llm/adapter_test.go b/internal/framework/llm/adapter_test.go index b687aa0..5f567b0 100644 --- a/internal/framework/llm/adapter_test.go +++ b/internal/framework/llm/adapter_test.go @@ -68,7 +68,7 @@ func adapterFixture(t *testing.T, replies []reply, retries, repairs int, hook fu base := fmt.Sprintf("version: 2\nbackends:\n offline:\n endpoint: %s/v1\n credential: ADAPTER_KEY\nllm:\n proposal_profile: base\n transient_retries: %d\n repair_attempts: %d\n", server.URL, retries, repairs) dir := profileLayout(t, base, "") main := filepath.Join(dir, "config.yml") - profile := "id: base\nbackend: offline\nmodel: full-model\n" + profile := "profiles:\n base:\n backend: offline\n model: full-model\n" if err := os.WriteFile(filepath.Join(dir, "profiles", "base.yaml"), []byte(profile), 0600); err != nil { t.Fatal(err) } @@ -301,7 +301,7 @@ func TestPreparedAdapterRejectsTargetDriftAndPreparationErrors(t *testing.T) { t.Fatalf("preparation failure dispatched: %v, %d", err, count.Load()) } // PrepareExecution reloads the profile, so a changed target must be blocked. - if err := os.WriteFile(filepath.Join(dir, "profiles", "base.yaml"), []byte("id: base\nbackend: offline\nendpoint: http://127.0.0.1:1/v1\nmodel: full-model\n"), 0600); err != nil { + if err := os.WriteFile(filepath.Join(dir, "profiles", "base.yaml"), []byte("profiles:\n base:\n backend: offline\n endpoint: http://127.0.0.1:1/v1\n model: full-model\n"), 0600); err != nil { t.Fatal(err) } req = adapterRequest(responseschema.CorrectionSetKey) diff --git a/internal/framework/llm/runtime_inspection_test.go b/internal/framework/llm/runtime_inspection_test.go index 765d9fa..96732a6 100644 --- a/internal/framework/llm/runtime_inspection_test.go +++ b/internal/framework/llm/runtime_inspection_test.go @@ -30,8 +30,8 @@ func profileLayout(t *testing.T, base, overlay string) string { } } for name, content := range map[string]string{ - "base": "id: base\nbackend: offline\nmodel: full-model\ntemperature: 0.3\nmax_tokens: 500\ntop_p: 0.8\ntimeout_seconds: 12\nservice_tier: priority\nreasoning_effort: medium\n", - "testing": "id: testing\nbackend: offline\nmodel: economy-model\n", + "base": "profiles:\n base:\n backend: offline\n model: full-model\n temperature: 0.3\n max_tokens: 500\n top_p: 0.8\n timeout_seconds: 12\n service_tier: priority\n reasoning_effort: medium\n", + "testing": "profiles:\n testing:\n backend: offline\n model: economy-model\n", } { if err := os.WriteFile(filepath.Join(dir, "profiles", name+".yaml"), []byte(content), 0600); err != nil { t.Fatal(err) @@ -188,9 +188,9 @@ func TestProfileAssemblyRejectsUnsafeSelections(t *testing.T) { dir := profileLayout(t, profileBase, "") main := filepath.Join(dir, "config.yml") for _, tc := range []struct{ name, profile string }{ - {"endpoint only", "id: custom\nendpoint: https://offline.invalid/v1\nmodel: model\n"}, - {"mismatched endpoint", "id: custom\nbackend: offline\nendpoint: https://elsewhere.invalid/v1\nmodel: model\n"}, - {"profile credential", "id: custom\nbackend: offline\nmodel: model\napi_key_env: OTHER_KEY\n"}, + {"endpoint only", "profiles:\n custom:\n endpoint: https://offline.invalid/v1\n model: model\n"}, + {"mismatched endpoint", "profiles:\n custom:\n backend: offline\n endpoint: https://elsewhere.invalid/v1\n model: model\n"}, + {"profile credential", "profiles:\n custom:\n backend: offline\n model: model\n api_key_env: OTHER_KEY\n"}, } { t.Run(tc.name, func(t *testing.T) { if err := os.WriteFile(filepath.Join(dir, "profiles", "custom.yaml"), []byte(tc.profile), 0600); err != nil { diff --git a/internal/framework/proposal_generation/adapter_integration_test.go b/internal/framework/proposal_generation/adapter_integration_test.go index 8af81c5..e810fc8 100644 --- a/internal/framework/proposal_generation/adapter_integration_test.go +++ b/internal/framework/proposal_generation/adapter_integration_test.go @@ -41,7 +41,7 @@ func TestRepairedProposalStillFacesDomainChecks(t *testing.T) { if err := os.WriteFile(main, []byte(content), 0600); err != nil { t.Fatal(err) } - if err := os.WriteFile(filepath.Join(dir, "profiles", "base.yaml"), []byte("id: base\nbackend: offline\nmodel: local-model\n"), 0600); err != nil { + if err := os.WriteFile(filepath.Join(dir, "profiles", "base.yaml"), []byte("profiles:\n base:\n backend: offline\n model: local-model\n"), 0600); err != nil { t.Fatal(err) } loaded, err := config.Load(ck.File(main), "") diff --git a/internal/framework/runner/cancellation_test.go b/internal/framework/runner/cancellation_test.go index db20cc3..02f2fe7 100644 --- a/internal/framework/runner/cancellation_test.go +++ b/internal/framework/runner/cancellation_test.go @@ -55,7 +55,7 @@ func TestValidatorFailureCancelsActiveAndPendingProviderWork(t *testing.T) { if err := os.WriteFile(main, []byte(body), 0600); err != nil { t.Fatal(err) } - if err := os.WriteFile(filepath.Join(dir, "profiles/base.yaml"), []byte("id: base\nbackend: shared\nmodel: local\ntimeout_seconds: 30\n"), 0600); err != nil { + if err := os.WriteFile(filepath.Join(dir, "profiles/base.yaml"), []byte("profiles:\n base:\n backend: shared\n model: local\n timeout_seconds: 30\n"), 0600); err != nil { t.Fatal(err) } loaded, err := config.Load(ck.File(main), "") diff --git a/internal/framework/validators/llm_integration_test.go b/internal/framework/validators/llm_integration_test.go index a2eadef..0be2cfc 100644 --- a/internal/framework/validators/llm_integration_test.go +++ b/internal/framework/validators/llm_integration_test.go @@ -55,7 +55,7 @@ func TestValidationRepairAndRuntimeFailuresThroughDomainBoundary(t *testing.T) { if err := os.WriteFile(main, []byte(content), 0600); err != nil { t.Fatal(err) } - if err := os.WriteFile(filepath.Join(dir, "profiles", "base.yaml"), []byte("id: base\nbackend: offline\nmodel: local-model\n"), 0600); err != nil { + if err := os.WriteFile(filepath.Join(dir, "profiles", "base.yaml"), []byte("profiles:\n base:\n backend: offline\n model: local-model\n"), 0600); err != nil { t.Fatal(err) } loaded, err := config.Load(ck.File(main), "")