diff --git a/docs/consumers/configuration-migration.md b/docs/consumers/configuration-migration.md index 400b2b9..d98321f 100644 --- a/docs/consumers/configuration-migration.md +++ b/docs/consumers/configuration-migration.md @@ -139,8 +139,10 @@ and diffs expose resolved values, recorded normalization and provenance. can apply further overrides, so the views are not promised to be identical. Remove `PromptVersion` and `PromptIdentity.Version` uses and the corresponding -`prompt_version` JSON members. Prompt hashes are opaque equality values and may -change when the removed field no longer participates in hashing. +`prompt_version` JSON members. Prompt definition hashes are opaque equality +values and may also change because redundant captured fields were removed. +Invalidate persisted caches or comparisons that span this change; hashes from +inspection and preparation of the same captured definition still agree. ## Identity Mapping diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index b311792..52b9205 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -804,6 +804,11 @@ pass on Go 1.27.3. The remaining file-source caller uses its three results. output overrides and hash-relation tests pass with independently specified behavior. No assertion of bit-identical previous hash values is added. +Completion: captured definitions use the validation contract's format and no +longer retain a redundant content-file path. Source-relative loading and +request override defaulting remain intact. Configuration, prompt, use-case, and +focused public tests pass on Go 1.27.3; migration guidance notes hash/cache impact. + ## Stage 32: Retire The Legacy Production Capacity Wrapper **Catalog:** 34. **Files:** runner scheduling test, capacity wrapper/tests/docs. diff --git a/internal/configuration/prompts.go b/internal/configuration/prompts.go index 3a2932c..f5fe9dd 100644 --- a/internal/configuration/prompts.go +++ b/internal/configuration/prompts.go @@ -87,7 +87,6 @@ func (state *loaded) materializePrompt(id string, raw promptConfig, base configk definition.Inputs = inputs definition.Templates = messages entry := &promptEntry{requirementInputs: inputMetadata, messages: compiledMessages} - definition.OutputFormat = contract.Format definition.Validation = contract if raw.SessionID != nil { var err error diff --git a/internal/domain/domain.go b/internal/domain/domain.go index 4412087..787d200 100644 --- a/internal/domain/domain.go +++ b/internal/domain/domain.go @@ -145,7 +145,6 @@ type PromptDefinition struct { SessionID string `yaml:"session_id" json:"session_id,omitempty"` Inputs []PromptInput `yaml:"inputs"` Templates []PromptMessageTemplate `yaml:"templates"` - OutputFormat OutputFormat `yaml:"output_format"` Validation OutputContract `yaml:"validation"` } @@ -170,7 +169,6 @@ type PromptInput struct { type PromptMessageTemplate struct { Role string `yaml:"role"` Content string `yaml:"content"` - ContentFile string `yaml:"content_file"` CacheControl *CacheControl `yaml:"cache_control,omitempty" json:"cache_control,omitempty"` } diff --git a/internal/prompt/renderer_test.go b/internal/prompt/renderer_test.go index 5703291..e38cf1d 100644 --- a/internal/prompt/renderer_test.go +++ b/internal/prompt/renderer_test.go @@ -49,7 +49,7 @@ func TestGoRenderer_Render(t *testing.T) { def := &domain.PromptDefinition{ Inputs: []domain.PromptInput{{Name: "transcript", Required: true}}, Templates: []domain.PromptMessageTemplate{ - {Role: "user", Content: "From file: {{input \"transcript\"}}", ContentFile: "/tmp/user.tmpl"}, + {Role: "user", Content: "From file: {{input \"transcript\"}}"}, }, } diff --git a/internal/usecase/runner.go b/internal/usecase/runner.go index 316de9d..487388a 100644 --- a/internal/usecase/runner.go +++ b/internal/usecase/runner.go @@ -641,9 +641,6 @@ func copyExtraParams(src map[string]any) map[string]any { func resolveOutputContract(def *domain.PromptDefinition, override *domain.OutputContract) (domain.OutputContract, error) { contract := def.Validation - if contract.Format == "" { - contract.Format = def.OutputFormat - } if override != nil { contract = *override if contract.Format == "" { diff --git a/internal/usecase/runner_test.go b/internal/usecase/runner_test.go index 3c4bdcb..c5f38ec 100644 --- a/internal/usecase/runner_test.go +++ b/internal/usecase/runner_test.go @@ -2504,7 +2504,6 @@ func promptDef(format domain.OutputFormat, mode domain.ValidationMode, attempts DefaultProfile: "exec", Inputs: []domain.PromptInput{{Name: "transcript", Required: true}}, Templates: []domain.PromptMessageTemplate{{Role: "user", Content: "x"}}, - OutputFormat: format, Validation: domain.OutputContract{ ValidationMode: mode, RepairAttempts: attempts,