Hub 2.26.0: the Church App, demo scenarios and devotionals

The App installs from New install on app.<address>, with Accounts 1.9.0
first, and is in every product list and filter (installs, Updates).
Every product has demo data; a demo client loads a whole demo scenario
in one seed-scenario job (agent 1.7.0), and installs show whether they
are out of step with it. The Website's and App's .env from the Hub.

Devotionals: written or imported from CSV up to 3 months ahead in the
free translations (KJV, BSB), and GET /api/v2/devotionals for App
licences. An alert when an App's active-member band is above its tier.

Contracts 1.23.0 vendored. Migration 20261130120000_app_scenarios_devotionals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 22:24:28 +02:00
co-authored by Claude Opus 5.5
parent 9b551bf9ed
commit 16f69afa6f
34 changed files with 1395 additions and 62 deletions
+18
View File
@@ -259,6 +259,24 @@ X-Hub-Install / X-Hub-Timestamp / X-Hub-Signature (as in §3)
- Rate-limited to 60 a minute per IP (against runaway loops; money is limited by the cap).
- A Hub older than 1.6.0 answers `404 NOT_FOUND`: the install treats that as "AI off".
## 3c. Devotionals (Church App, Hub 2.26.0)
`GET /api/v2/devotionals?from=YYYY-MM-DD` (contracts `hub.DEVOTIONALS_PATH`), with
`Authorization: Bearer <the install's licence token>` (§4); no signature. An App set to "From
Cross Code" calls it once a night (and on "Sync now") and keeps what it gets, so a Hub outage
changes nothing.
- `from` defaults to today (South Africa); the answer covers `from` to 3 months on, one
devotional per day at most, oldest first (`devotionalsReplySchema`, `crosscode.devotional/1`,
each with `source: "crosscode"`). The App replaces its copy of that range: a day missing from
the list was removed in the Hub.
- Only the free translations are ever in it (KJV, BSB: contracts `FREE_BIBLE_TRANSLATION_IDS`);
the App shows each passage's `copyright` line under it.
- `401 BAD_LICENCE`: no token, a forged one, or an unknown licence. `403 NOT_AN_APP`: another
product's licence. `403 LICENCE_INACTIVE`: suspended, revoked, or past its grace days.
`400 INVALID_REQUEST`: `from` isn't a date. Rate-limited to 20 a minute per IP.
- A Hub older than 2.26.0 answers `404 NOT_FOUND`: the App keeps what it has.
## 4. Licence token
`hel1.<payload>.<signature>` — `payload` is base64url JSON, `signature` is the base64url