From 3e67743fbf504c896bbf205d27844bb1e20a94a7 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 2 Nov 2026 12:51:26 +0000 Subject: [PATCH] Update internal execution fixtures for identified resources --- docs/roadmap/implementation.md | 4 +++ internal/usecase/smoke_inference_test.go | 6 ++-- internal/usecase/smoke_selection_test.go | 40 ++++++++++++++---------- internal/usecase/smoke_tester_test.go | 4 +-- 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index f6d09c0..fc05668 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -727,6 +727,10 @@ internal observation fixtures affected by resource lists or removed labels. Validation: run the affected internal packages with final values and synthetic sources. Resolve remaining label-related compilation errors in these packages. +Completion: internal smoke-selection and execution fixtures now use identified +resource lists, preserving their configured routing and diagnostic behavior. +The use-case, prompt, domain, and observation package suites passed on Go 1.27.0. + ## Stage 17: Migrate Public Preparation And Execution Contracts Scope: root ordinary/prepared execution, concrete-request validation, diff --git a/internal/usecase/smoke_inference_test.go b/internal/usecase/smoke_inference_test.go index 7cd9852..04d2a99 100644 --- a/internal/usecase/smoke_inference_test.go +++ b/internal/usecase/smoke_inference_test.go @@ -76,10 +76,10 @@ func TestSmokeTesterRunsPrivateInferenceCasesThroughInjectedCoordinator(t *testi func TestSmokeTesterConcludesMissingRequiredCredentialWithoutDispatch(t *testing.T) { values := smokeSelectionConfig() - profiles := values["profiles"].(map[string]any) - profiles["required-profile"] = map[string]any{ + profiles := values["profiles"].([]any) + values["profiles"] = append(profiles, map[string]any{"id": "required-profile", "backend": "alpha", "model": "required-model", "api_key_required": true, - } + }) runner := smokeTesterRunner(t, values) admitter := &smokeAdmissionSpy{} runner.admitter = admitter diff --git a/internal/usecase/smoke_selection_test.go b/internal/usecase/smoke_selection_test.go index a7bb088..e4a6f60 100644 --- a/internal/usecase/smoke_selection_test.go +++ b/internal/usecase/smoke_selection_test.go @@ -318,8 +318,8 @@ func newSmokeSelectionRunner(t *testing.T) (*Runner, *selectionTestCollaborators func smokeSelectionConfig() map[string]any { return map[string]any{ - "backends": map[string]any{ - "alpha": map[string]any{ + "backends": []any{ + map[string]any{"id": "alpha", "endpoint": "https://alpha.example/v1", "smoke_tests": map[string]any{ "default_profile": "cross-backend-profile", @@ -327,29 +327,28 @@ func smokeSelectionConfig() map[string]any { "authentication": map[string]any{"kind": "openrouter_key"}, }, }, - "beta": map[string]any{ + map[string]any{"id": "beta", "endpoint": "https://beta.example/v1", "smoke_tests": map[string]any{"authentication": map[string]any{"kind": "openrouter_key"}}, }, - "delta": map[string]any{ + map[string]any{"id": "delta", "endpoint": "https://delta.example/v1", "smoke_tests": map[string]any{"default_profile": "not-yet-defined"}, }, - "epsilon": map[string]any{ + map[string]any{"id": "epsilon", "endpoint": "https://epsilon.example/v1", "smoke_tests": map[string]any{"default_profile": "endpoint-profile"}, }, }, - "profiles": map[string]any{ - "alpha-profile": map[string]any{"backend": "alpha", "model": "alpha-model"}, - "prompt-profile": map[string]any{"backend": "beta", "model": "prompt-model"}, - "cross-backend-profile": map[string]any{"backend": "beta", "model": "cross-model"}, - "endpoint-profile": map[string]any{"endpoint": "https://endpoint-only.example/v1", "model": "endpoint-model"}, - "incomplete-profile": map[string]any{"backend": "alpha"}, + "profiles": []any{ + map[string]any{"id": "alpha-profile", "backend": "alpha", "model": "alpha-model"}, + map[string]any{"id": "prompt-profile", "backend": "beta", "model": "prompt-model"}, + map[string]any{"id": "cross-backend-profile", "backend": "beta", "model": "cross-model"}, + map[string]any{"id": "endpoint-profile", "endpoint": "https://endpoint-only.example/v1", "model": "endpoint-model"}, + map[string]any{"id": "incomplete-profile", "backend": "alpha"}, }, - "prompts": map[string]any{ - "selection.prompt": map[string]any{ - "version": "v1", + "prompts": []any{ + map[string]any{"id": "selection.prompt", "default_profile": "prompt-profile", "inputs": []any{map[string]any{"name": "required_input", "required": true}}, "messages": []any{map[string]any{"role": "user", "content": "Hello {{.required_input}}"}}, @@ -358,8 +357,7 @@ func smokeSelectionConfig() map[string]any { "format": "json", "validation_mode": "json_schema", "schema_path": "not-read.json", }, }, - "backend.prompt": map[string]any{ - "version": "v1", + map[string]any{"id": "backend.prompt", "messages": []any{map[string]any{"role": "user", "content": "Hello"}}, "output": map[string]any{ "format": "json", "validation_mode": "json_schema", "schema_path": "not-read.json", @@ -368,3 +366,13 @@ func smokeSelectionConfig() map[string]any { }, } } + +func smokeSelectionBackend(values map[string]any, id string) map[string]any { + for _, item := range values["backends"].([]any) { + backend := item.(map[string]any) + if backend["id"] == id { + return backend + } + } + return nil +} diff --git a/internal/usecase/smoke_tester_test.go b/internal/usecase/smoke_tester_test.go index 2e3ea46..93873e2 100644 --- a/internal/usecase/smoke_tester_test.go +++ b/internal/usecase/smoke_tester_test.go @@ -19,7 +19,7 @@ import ( func TestSmokeTesterAssemblesReachabilityReportWithoutGenerationAdmission(t *testing.T) { values := smokeSelectionConfig() - alpha := values["backends"].(map[string]any)["alpha"].(map[string]any) + alpha := smokeSelectionBackend(values, "alpha") alphaSmoke := alpha["smoke_tests"].(map[string]any) alphaReachability := alphaSmoke["reachability"].(map[string]any) alphaReachability["endpoint"] = "https://operator:private@example.invalid/health?check=1" @@ -166,7 +166,7 @@ func TestSmokeTesterReportsUnsupportedAndInapplicableAuthentication(t *testing.T t.Run(tc.name, func(t *testing.T) { values := smokeSelectionConfig() if tc.configureNone { - backend := values["backends"].(map[string]any)[tc.backend].(map[string]any) + backend := smokeSelectionBackend(values, tc.backend) backend["smoke_tests"].(map[string]any)["authentication"] = map[string]any{"kind": "none"} } runner := smokeTesterRunner(t, values)