Phase 7 part 5: add a section to an existing page

Sites → Sections and pages → Add a section, on any page built from
sections: choose one of the site's section types and where it goes; the
AI writes it from the page, its searches, the profile and the Inventory,
with the same rules as a new page. It's reviewed like a page (claims to
confirm, to-dos), and the pull request inserts it into the page's file as
text, so only that section is added; the build checks it. What to write
next suggests a FAQ for a section page found with questions, and a
comparison for one searched against something else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 07:25:19 -07:00
co-authored by Claude Opus 5.5
parent 5705a9b58b
commit fdfbcd3d3d
15 changed files with 873 additions and 39 deletions
+29
View File
@@ -9,6 +9,7 @@ import (
"supermarket/internal/db"
"supermarket/internal/profile"
"supermarket/internal/prospects"
"supermarket/internal/seo"
"supermarket/internal/signals"
)
@@ -88,3 +89,31 @@ func TestOwnWords(t *testing.T) {
t.Errorf("quoted: %q", got)
}
}
func TestSectionIdeas(t *testing.T) {
pages := []SectionPage{
{Path: "/freescout/", Title: "FreeScout", Types: []string{"hero", "text"}},
{Path: "/pricing/", Title: "Pricing", Types: []string{"hero", "faq"}},
}
searches := map[string][]seo.QueryRow{
"/freescout/": {
{Query: "how to install freescout", Numbers: seo.Numbers{Impressions: 40}},
{Query: "is freescout free?", Numbers: seo.Numbers{Impressions: 30}},
{Query: "freescout vs help scout", Numbers: seo.Numbers{Impressions: 20}},
{Query: "zendesk pricing per agent", Numbers: seo.Numbers{Impressions: 40}},
{Query: "freescout", Numbers: seo.Numbers{Impressions: 3000}},
},
"/pricing/": {{Query: "how much does it cost", Numbers: seo.Numbers{Impressions: 500}}},
}
got := SectionIdeas(pages, searches, []string{"hero", "text", "faq", "table"}, []string{"Zendesk"}, 0, 0)
if len(got) != 2 {
t.Fatalf("got %+v", got)
}
f, c := got[0], got[1]
if f.Kind != "Add a FAQ" || !strings.Contains(f.Why, "70 times") || !strings.Contains(f.Action.URL, "type=faq") || !strings.Contains(f.Action.URL, "page=%2Ffreescout%2F") {
t.Errorf("faq: %+v", f)
}
if c.Kind != "Add a comparison" || !strings.Contains(c.Why, "60 times") || !strings.Contains(c.Action.URL, "type=table") {
t.Errorf("comparison: %+v", c)
}
}