fix
This commit is contained in:
@@ -82,26 +82,18 @@ func TestResolveProductPromptTemplates_categoryWithTitleFormula(t *testing.T) {
|
||||
TitleTemplate: title,
|
||||
DescriptionTemplate: desc,
|
||||
})
|
||||
if !strings.Contains(user, "Emphasize energy class") {
|
||||
t.Fatalf("missing category prompt: %s", user)
|
||||
// Structured formulas trigger A1-style GPT predloga (legacy generator.php behavior).
|
||||
if !strings.Contains(sys, "Si tekstopisec") {
|
||||
t.Fatalf("expected A1 system when formulas set: %s", sys)
|
||||
}
|
||||
if !strings.Contains(user, "applies to name, description, and attrs") {
|
||||
t.Fatalf("missing category title framing: %s", user)
|
||||
if !strings.Contains(user, "GPT predloga:") {
|
||||
t.Fatalf("expected GPT predloga user: %s", user)
|
||||
}
|
||||
if !strings.Contains(user, "Title formula") || !strings.Contains(user, "attr [brand]") {
|
||||
t.Fatalf("missing title formula: %s", user)
|
||||
if !strings.Contains(user, "Emphasize energy class") && !strings.Contains(user, "<name>") {
|
||||
t.Fatalf("expected title/desc formula in predloga: %s", user)
|
||||
}
|
||||
if !strings.Contains(user, "Description formula") || !strings.Contains(user, "- p: Factual summary") {
|
||||
t.Fatalf("missing description formula: %s", user)
|
||||
}
|
||||
if !strings.Contains(sys, `When the user message includes a "Title formula"`) {
|
||||
t.Fatalf("missing title system override: %s", sys)
|
||||
}
|
||||
if !strings.Contains(sys, "Description formula") {
|
||||
t.Fatalf("missing description system override: %s", sys)
|
||||
}
|
||||
if !strings.Contains(sys, `apply it to "name", "description", and "attrs"`) {
|
||||
t.Fatalf("missing category system overlay: %s", sys)
|
||||
if !strings.Contains(user, "<p>{Factual summary}</p>") && !strings.Contains(user, "Factual summary") {
|
||||
t.Fatalf("missing description formula HTML: %s", user)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,20 +115,17 @@ func TestResolveProductPromptTemplates_derivesFormulaFromPromptHTML(t *testing.T
|
||||
// Empty structured template — production A1 path often only has prompt HTML.
|
||||
DescriptionTemplate: nil,
|
||||
})
|
||||
if !strings.Contains(user, "Description formula") {
|
||||
t.Fatalf("expected Description formula derived from prompt HTML:\n%s", user)
|
||||
if !strings.Contains(sys, "Si tekstopisec") {
|
||||
t.Fatalf("expected A1 copywriter system:\n%s", sys)
|
||||
}
|
||||
if !strings.Contains(user, "- h2:") || !strings.Contains(user, "- p:") || !strings.Contains(user, "- ul:") {
|
||||
t.Fatalf("expected h2/p/ul sections in formula:\n%s", user)
|
||||
if !strings.Contains(user, "GPT predloga:") || !strings.Contains(user, "<name>{") {
|
||||
t.Fatalf("expected legacy GPT predloga with <name>:\n%s", user)
|
||||
}
|
||||
if !strings.Contains(sys, "Description formula") {
|
||||
t.Fatalf("missing description system override:\n%s", sys)
|
||||
if !strings.Contains(user, "<H2>{") && !strings.Contains(user, "<h2>{") {
|
||||
t.Fatalf("expected HTML description formula in predloga:\n%s", user)
|
||||
}
|
||||
if !strings.Contains(sys, `"name" MUST be rewritten`) {
|
||||
t.Fatalf("missing title rewrite system override:\n%s", sys)
|
||||
}
|
||||
if !strings.Contains(user, "Title instructions (REQUIRED") {
|
||||
t.Fatalf("missing Title section constraint:\n%s", user)
|
||||
if strings.Contains(user, "Category guidance (applies to name") {
|
||||
t.Fatal("A1 path must not use soft category guidance overlay")
|
||||
}
|
||||
effective := aiprompts.EffectiveDescriptionTemplateAny(nil, prompt)
|
||||
if descriptionSatisfiesFormula("plain Slovenian prose without tags", effective) {
|
||||
|
||||
Reference in New Issue
Block a user