Split A1 category prompts canonically; retire attributes prompting
- Category enhance prompts (Sync A1 / seed-a1 / repair) now use the same three role sections as the rest of the platform: Title / Description / Meta. The retired "--- Attributes ---" role section is removed from the canonical template, the legacy-split overlay, and the web prompt editor; Category/Attrs stay as plain product-context lines (attribute extraction remains pipeline-level via AppendAttributeConstraints). - Stored prompts still carrying an attributes section are detected by CategoryEnhancePromptNeedsRepair and rewritten on the next Sync. - Legacy wp_product_categories.sql splits now also seed a default Slovenian metaTitle rule (dumps only carried <metaDescription>), so every A1 category gets all four prompt areas: title formula, description sections, meta title, meta description. - Role-sectioned prompts no longer imply the A1 SEO-omit cohort (CompanyOmitsSEOMeta): sectioned prompts are the canonical prompt-editor output for every tenant, and the sniff silently disabled SEO meta for any company that saved a category prompt. - Verified locally: repair-category-prompts -apply updated 238 A1 + Platform Demo categories from scripts/seed/wp_product_categories.sql (216 legacy splits), idempotent on re-run, zero attributes sections left in DB. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,19 +42,19 @@ func TestStripCatalogSEOMetaIfOmitted(t *testing.T) {
|
||||
other := uuid.MustParse("11111111-1111-1111-1111-111111111111")
|
||||
|
||||
item := catalogSEOItem()
|
||||
stripCatalogSEOMetaIfOmitted(processing.CompanyOmitsSEOMetaLookup(other, "", "Acme", false), item)
|
||||
stripCatalogSEOMetaIfOmitted(processing.CompanyOmitsSEOMetaLookup(other, "", "Acme"), item)
|
||||
if item["meta_title"] != "T" {
|
||||
t.Fatalf("ordinary company must keep meta: %v", item["meta_title"])
|
||||
}
|
||||
|
||||
stripCatalogSEOMetaIfOmitted(processing.CompanyOmitsSEOMetaLookup(a1, "", "", false), item)
|
||||
stripCatalogSEOMetaIfOmitted(processing.CompanyOmitsSEOMetaLookup(a1, "", ""), item)
|
||||
assertCatalogSEOOmitted(t, item)
|
||||
}
|
||||
|
||||
func TestStripCatalogSEOMetaIfOmitted_demoByName(t *testing.T) {
|
||||
t.Parallel()
|
||||
other := uuid.MustParse("11111111-1111-1111-1111-111111111111")
|
||||
omit := processing.CompanyOmitsSEOMetaLookup(other, "", " platform demo ", false)
|
||||
omit := processing.CompanyOmitsSEOMetaLookup(other, "", " platform demo ")
|
||||
if !omit {
|
||||
t.Fatal("Platform Demo by name must omit SEO meta")
|
||||
}
|
||||
@@ -63,14 +63,12 @@ func TestStripCatalogSEOMetaIfOmitted_demoByName(t *testing.T) {
|
||||
assertCatalogSEOOmitted(t, item)
|
||||
}
|
||||
|
||||
func TestStripCatalogSEOMetaIfOmitted_a1PromptMarkers(t *testing.T) {
|
||||
func TestStripCatalogSEOMetaIfOmitted_sectionedPromptsKeepMeta(t *testing.T) {
|
||||
t.Parallel()
|
||||
// Role-sectioned category prompts are the canonical prompt-editor shape for
|
||||
// every tenant now — using them must NOT put a company in the SEO-omit cohort.
|
||||
other := uuid.MustParse("11111111-1111-1111-1111-111111111111")
|
||||
omit := processing.CompanyOmitsSEOMetaLookup(other, "", "Acme", true)
|
||||
if !omit {
|
||||
t.Fatal("A1-style prompt markers must omit SEO meta")
|
||||
if processing.CompanyOmitsSEOMetaLookup(other, "", "Acme") {
|
||||
t.Fatal("ordinary company must keep SEO meta regardless of prompt shape")
|
||||
}
|
||||
item := catalogSEOItem()
|
||||
stripCatalogSEOMetaIfOmitted(omit, item)
|
||||
assertCatalogSEOOmitted(t, item)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user