Phase 3 part 4: changes approved one at a time, as Gitea pull requests

Proposals (at most 3 waiting) for pages on page one without clicks and
for the audit's title and description issues: the AI writes the title
(without the site's suffix, within the pixel budget) and description
from the live page and its searches. A yes syncs a working copy of the
site's Gitea repository (token as a header only), finds the page's Hugo
content file, sets title and description in its front matter, builds
with Hugo to check the page comes out as proposed, pushes a branch and
opens a pull request; it never merges. Merged changes are checked on
the live site, then compared before and after from Search Console.
Hugo is in the image. Schema 15.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 08:04:01 -07:00
co-authored by Claude Opus 5.5
parent 43a7b42126
commit 438192faba
26 changed files with 2267 additions and 11 deletions
+25 -3
View File
@@ -71,12 +71,34 @@ func Weekly(d *db.DB, site string, now time.Time) (*Report, error) {
}
}
r.Pages = pages
ranks, err := WhatRanks(d, site)
// The changes proposed for the site, or else the pages to push.
rows, err := d.Query(`SELECT `+changeCols+` FROM seo_changes WHERE property = ? AND status = ? ORDER BY id LIMIT ?`,
site, ChangeProposed, MaxWaiting)
if err != nil {
return nil, err
}
if ranks != nil {
r.Waiting = ranks.Push
proposed, err := scanChanges(rows)
if err != nil {
return nil, err
}
for _, c := range proposed {
var what []string
if c.NewTitle != "" {
what = append(what, fmt.Sprintf("New title: “%s” (%d characters, about %d px).", c.NewTitle, c.NewTitleChars(), c.NewTitlePixels()))
}
if c.NewDescription != "" {
what = append(what, fmt.Sprintf("New description: “%s”.", c.NewDescription))
}
r.Waiting = append(r.Waiting, Pick{Page: c.Page, Why: strings.Join(what, " ") + " Why: " + c.Why})
}
if len(r.Waiting) == 0 {
ranks, err := WhatRanks(d, site)
if err != nil {
return nil, err
}
if ranks != nil {
r.Waiting = ranks.Push
}
}
return r, nil
}