fix
This commit is contained in:
@@ -49,6 +49,11 @@ func DescriptionTemplateNeedsRepair(template any) bool {
|
||||
// name-first Slovenian instruction style with the SEO title length bound.
|
||||
const DefaultLegacyMetaTitleRule = "Najprej napiši Novo ime izdelka in dodaj glavno prednost. Dolžina 50-60 znakov vključno s presledki."
|
||||
|
||||
// DefaultMetaTitleRuleEN is the same instruction for the English platform-default
|
||||
// formulas. Legacy dumps carry only a <metaDescription> rule, so the meta title
|
||||
// instruction is supplied here in the language of the formula set.
|
||||
const DefaultMetaTitleRuleEN = "Start with the New product name and add the main benefit. Length 50-60 characters including spaces."
|
||||
|
||||
// DeriveDescriptionFormulaFromLegacyParts builds description_template from split
|
||||
// legacy DescriptionRules HTML + MetaRules. Legacy dumps never carried a meta
|
||||
// title rule, so meta intent (MetaRules present) also seeds a default metaTitle
|
||||
@@ -198,7 +203,14 @@ func EffectiveDescriptionFormula(stored any, categoryPrompt string) DescriptionF
|
||||
WasLegacy: true,
|
||||
})
|
||||
}
|
||||
if len(derived.Sections) > len(out.Sections) {
|
||||
// A legacy HTML formula in the category prompt is the tenant's own authored
|
||||
// structure, so it wins outright — it is also what buildA1StyleEnhanceUserTemplate
|
||||
// puts in the GPT predloga. Preferring it only when it has MORE sections let a
|
||||
// stale stored template (e.g. seven English boilerplate sections from an old
|
||||
// migration) validate against a five-section prompt: the model obeyed the prompt,
|
||||
// the gate rejected the reply as formula-mismatch, and enhance fell back to synth
|
||||
// or supplier copy. Instruction and gate must read the same formula.
|
||||
if len(derived.Sections) > 0 {
|
||||
out.Sections = derived.Sections
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user