fix
This commit is contained in:
@@ -14,6 +14,9 @@ func TestCategoryEnhanceTemplateHasAttrs(t *testing.T) {
|
||||
if !strings.Contains(tpl, "{{attrs}}") {
|
||||
t.Fatalf("template missing {{attrs}}: %q", tpl)
|
||||
}
|
||||
if !aiprompts.CategoryEnhanceHasRoleSections(tpl) {
|
||||
t.Fatal("repaired template must include title/description/meta/attributes sections")
|
||||
}
|
||||
if !aiprompts.CategoryEnhancePromptNeedsRepair("legacy HTML prompt without attrs") {
|
||||
t.Fatal("expected legacy prompt to need repair")
|
||||
}
|
||||
|
||||
@@ -32,14 +32,15 @@ type RepairCategoryEnhancePromptsResult struct {
|
||||
}
|
||||
|
||||
// RepairA1DemoCategoryEnhancePrompts replaces legacy HTML marketing categories.prompt
|
||||
// values for A1 Slovenija + Platform Demo with aiprompts.CategoryEnhanceUserTemplate.
|
||||
// values for A1 Slovenija + Platform Demo with aiprompts.CategoryEnhanceUserTemplate
|
||||
// (role-sectioned title/description/meta/attributes USER overlay).
|
||||
//
|
||||
// LOCAL repair only (idempotent):
|
||||
// - Writes JSON-compatible user overlays under both "sl" (prompt->>'sl') and "*"
|
||||
// (LangPromptAny) so language stays via {{language}}, not hardcoded-only copy.
|
||||
// - Touches ONLY categories.prompt — never title_template / description_template
|
||||
// (unique name/description formulas stay intact; AppendFormulaConstraints encodes
|
||||
// them as plain-text instructions at enhance render time).
|
||||
// (unique name/description/meta formulas stay intact; AppendFormulaConstraints
|
||||
// encodes them as plain-text instructions at enhance render time).
|
||||
// - dryRun=true: count WouldUpdate only; dryRun=false: apply and set Updated.
|
||||
//
|
||||
// Entrypoint: go run ./cmd/repair-category-prompts (-dry-run | -apply).
|
||||
|
||||
Reference in New Issue
Block a user