Remove redundant captured prompt fields

This commit is contained in:
2026-11-05 14:34:05 +00:00
parent 7db5572b62
commit cee9bbc7b2
7 changed files with 10 additions and 10 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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"`
}

View File

@@ -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\"}}"},
},
}

View File

@@ -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 == "" {

View File

@@ -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,