Remove redundant captured prompt fields
This commit is contained in:
@@ -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.
|
can apply further overrides, so the views are not promised to be identical.
|
||||||
|
|
||||||
Remove `PromptVersion` and `PromptIdentity.Version` uses and the corresponding
|
Remove `PromptVersion` and `PromptIdentity.Version` uses and the corresponding
|
||||||
`prompt_version` JSON members. Prompt hashes are opaque equality values and may
|
`prompt_version` JSON members. Prompt definition hashes are opaque equality
|
||||||
change when the removed field no longer participates in hashing.
|
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
|
## Identity Mapping
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
output overrides and hash-relation tests pass with independently specified
|
||||||
behavior. No assertion of bit-identical previous hash values is added.
|
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
|
## Stage 32: Retire The Legacy Production Capacity Wrapper
|
||||||
|
|
||||||
**Catalog:** 34. **Files:** runner scheduling test, capacity wrapper/tests/docs.
|
**Catalog:** 34. **Files:** runner scheduling test, capacity wrapper/tests/docs.
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ func (state *loaded) materializePrompt(id string, raw promptConfig, base configk
|
|||||||
definition.Inputs = inputs
|
definition.Inputs = inputs
|
||||||
definition.Templates = messages
|
definition.Templates = messages
|
||||||
entry := &promptEntry{requirementInputs: inputMetadata, messages: compiledMessages}
|
entry := &promptEntry{requirementInputs: inputMetadata, messages: compiledMessages}
|
||||||
definition.OutputFormat = contract.Format
|
|
||||||
definition.Validation = contract
|
definition.Validation = contract
|
||||||
if raw.SessionID != nil {
|
if raw.SessionID != nil {
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ type PromptDefinition struct {
|
|||||||
SessionID string `yaml:"session_id" json:"session_id,omitempty"`
|
SessionID string `yaml:"session_id" json:"session_id,omitempty"`
|
||||||
Inputs []PromptInput `yaml:"inputs"`
|
Inputs []PromptInput `yaml:"inputs"`
|
||||||
Templates []PromptMessageTemplate `yaml:"templates"`
|
Templates []PromptMessageTemplate `yaml:"templates"`
|
||||||
OutputFormat OutputFormat `yaml:"output_format"`
|
|
||||||
Validation OutputContract `yaml:"validation"`
|
Validation OutputContract `yaml:"validation"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +169,6 @@ type PromptInput struct {
|
|||||||
type PromptMessageTemplate struct {
|
type PromptMessageTemplate struct {
|
||||||
Role string `yaml:"role"`
|
Role string `yaml:"role"`
|
||||||
Content string `yaml:"content"`
|
Content string `yaml:"content"`
|
||||||
ContentFile string `yaml:"content_file"`
|
|
||||||
CacheControl *CacheControl `yaml:"cache_control,omitempty" json:"cache_control,omitempty"`
|
CacheControl *CacheControl `yaml:"cache_control,omitempty" json:"cache_control,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func TestGoRenderer_Render(t *testing.T) {
|
|||||||
def := &domain.PromptDefinition{
|
def := &domain.PromptDefinition{
|
||||||
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
||||||
Templates: []domain.PromptMessageTemplate{
|
Templates: []domain.PromptMessageTemplate{
|
||||||
{Role: "user", Content: "From file: {{input \"transcript\"}}", ContentFile: "/tmp/user.tmpl"},
|
{Role: "user", Content: "From file: {{input \"transcript\"}}"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -641,9 +641,6 @@ func copyExtraParams(src map[string]any) map[string]any {
|
|||||||
|
|
||||||
func resolveOutputContract(def *domain.PromptDefinition, override *domain.OutputContract) (domain.OutputContract, error) {
|
func resolveOutputContract(def *domain.PromptDefinition, override *domain.OutputContract) (domain.OutputContract, error) {
|
||||||
contract := def.Validation
|
contract := def.Validation
|
||||||
if contract.Format == "" {
|
|
||||||
contract.Format = def.OutputFormat
|
|
||||||
}
|
|
||||||
if override != nil {
|
if override != nil {
|
||||||
contract = *override
|
contract = *override
|
||||||
if contract.Format == "" {
|
if contract.Format == "" {
|
||||||
|
|||||||
@@ -2504,7 +2504,6 @@ func promptDef(format domain.OutputFormat, mode domain.ValidationMode, attempts
|
|||||||
DefaultProfile: "exec",
|
DefaultProfile: "exec",
|
||||||
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
||||||
Templates: []domain.PromptMessageTemplate{{Role: "user", Content: "x"}},
|
Templates: []domain.PromptMessageTemplate{{Role: "user", Content: "x"}},
|
||||||
OutputFormat: format,
|
|
||||||
Validation: domain.OutputContract{
|
Validation: domain.OutputContract{
|
||||||
ValidationMode: mode,
|
ValidationMode: mode,
|
||||||
RepairAttempts: attempts,
|
RepairAttempts: attempts,
|
||||||
|
|||||||
Reference in New Issue
Block a user