Phase 6 part 5, step 3: theme updates by pull request

The theme carries a MANIFEST of its files' SHA-256s. A site's Theme card
shows its copy's version against Supermarket's and any files changed by
hand; Update the theme opens a pull request that writes new and changed
files, removes retired ones, rebuilds, and lists what it replaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:30:48 -07:00
co-authored by Claude Opus 5.5
parent 2a605ac265
commit 7da7c5fd9c
9 changed files with 384 additions and 6 deletions
+15
View File
@@ -1439,6 +1439,21 @@ shared theme for new sites (deferred in Phase 5).
the form). Commits are by the Core's user "via Supermarket"
(`commitAuthor`). Deploying the new site is still the user's Gitea hook.
**Step 3 built (2026-11-22; no schema change).** The theme carries a
`MANIFEST` (each file's SHA-256) beside its `VERSION`, so a site's copy
can be checked for files changed by hand. Sites → Sections and pages
shows a *Theme* card on sites using it: their version against
Supermarket's, the files changed by hand, and *Update the theme* when
Supermarket's is newer. The update (`supermarket/theme-<n>`) writes the
new and changed files, removes the ones the theme no longer has,
rebuilds, and opens a pull request listing what changed, was added and
removed, and which hand-edited files it replaces (changes belong in the
site's own `layouts/` or `static/`, which win over the theme). To ship a
theme change: edit `internal/theme/files/`, raise `theme.Version`.
**Part 5 is complete**, and with it Phase 6's plan. Not tried for real: a
new site on the real Gitea (the user creates the empty repository).
**Part 1 built (2026-11-22; no schema change).** `internal/backup` makes
backups with `VACUUM INTO` (to a `.part` file, then renamed; mode 0600)
into `<data>/backups`, named `app-<yyyymmdd>-<hhmmss>-<kind>[-<note>].db`