Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad40618267 |
@@ -63,6 +63,10 @@ a test server (both done 2026-10-28).
|
||||
|
||||
1. **1.51.0 — TypeScript backend, OpenAPI and `/api/v2`** (§14), then **2.0.0 — AI helpers** (§15).
|
||||
Languages (Afrikaans, §10) are removed from scope (2026-10-28).
|
||||
2. AI rules decided 2026-10-29 (see §15 in the roadmap): the AI buttons show only when the
|
||||
licence's monthly cap is above R0, and are disabled (not hidden) once it's reached. The Hub
|
||||
charges the real cost plus a markup % (a default and a per-licence override) and counts the cap
|
||||
in charged rand. AI endpoints are `/api/v2` only.
|
||||
|
||||
## Working on this repo
|
||||
|
||||
|
||||
+34
-5
@@ -879,11 +879,34 @@ an install (one leaked install would leak it for everyone), so:
|
||||
the install secret like the heartbeat. The Hub adds the key, calls Claude, and returns
|
||||
the result. Still **install → Hub only** — the Hub never reaches into an install.
|
||||
- **The Hub meters every call** in rand: tokens used × the model's price × an exchange rate
|
||||
Joshua sets in the Hub (with an optional margin). Usage is kept per install per month.
|
||||
Joshua sets in the Hub × **(1 + markup)**. Usage is kept per install per month, as both the
|
||||
real cost and the charged (marked-up) amount.
|
||||
- **Markup** (decided 2026-10-29): one percentage set in the Hub (a default for every licence,
|
||||
with an override per licence), e.g. 40%. It does two jobs: it covers Joshua if a month's real
|
||||
usage runs a little over (exchange-rate moves, a last call that costs more than expected), and
|
||||
it is his profit on AI. Churches only ever see the charged amount in rand. The real cost, the
|
||||
markup and the profit are shown only in the Hub.
|
||||
- **Monthly rand cap per licence**, set by Joshua in the Hub to match what the church pays
|
||||
(e.g. R0 = AI off, R50, R200). The licence's cap is the first per-plan limit. At 80% the
|
||||
install's admins get a warning email; at 100% the helpers are switched off until the next
|
||||
month (or until Joshua raises the cap). Optional per-user daily limit against runaway use.
|
||||
(e.g. R0 = AI off, R50, R200). The licence's cap is the first per-plan limit. The cap is
|
||||
counted in **charged** rand, so the real spend can never be more than cap ÷ (1 + markup).
|
||||
- **Hard stop, checked before each call:** the Hub refuses a call when *charged so far + the
|
||||
worst case for this call* (its prompt plus the helper's `max_tokens`, priced with markup) would
|
||||
pass the cap. A month can't run over by more than the markup already covers, even with
|
||||
several people clicking at once (the check and the usage record happen in one transaction).
|
||||
At 80% the install's admins get a warning email. Optional per-user daily limit against
|
||||
runaway use.
|
||||
- **The buttons follow the cap** (decided 2026-10-29):
|
||||
- **Cap R0** (or AI off on the licence, or the install not connected to the Hub): the AI
|
||||
buttons are **not shown at all**, anywhere.
|
||||
- **Cap above R0, room left:** the buttons show and work.
|
||||
- **Cap reached:** the buttons stay where they are but are **disabled**, with a tooltip like
|
||||
"This month's AI allowance is used up — it renews on 1 December". They come back by
|
||||
themselves next month, or as soon as Joshua raises the cap.
|
||||
- The install learns this from `GET /api/v2/ai/status` → `{ enabled, capReached, renewsOn,
|
||||
helpers }`. The answer is cached briefly from the Hub and refreshed after every call.
|
||||
Every AI call also returns the new status, so the buttons disable straight after the call
|
||||
that used up the cap. The backend checks again on each request, so a stale page can't get
|
||||
past the cap.
|
||||
- **Admins see their usage** in Site settings → AI: used this month (R and number of uses),
|
||||
the cap, a daily chart, use per helper and per person, and an on/off switch per helper.
|
||||
- If the Hub or Claude is unavailable, the buttons say so; nothing else in the app is affected.
|
||||
@@ -904,7 +927,12 @@ an install (one leaked install would leak it for everyone), so:
|
||||
|
||||
- Install: `backend/src/ai/` — one client for the Hub's AI endpoint, one prompt + schema
|
||||
per helper, usage shown from the Hub. Feature flag per helper, all off when the licence
|
||||
has no AI or the Hub isn't connected.
|
||||
has no AI or the Hub isn't connected. The AI endpoints exist **only in `/api/v2`**
|
||||
(`/api/v2/ai/status`, `/api/v2/ai/<helper>`), built on 1.51's schemas and error format.
|
||||
The frontend has one `useAiStatus()` hook and an `<AiButton>` that hides, enables or
|
||||
disables itself from it.
|
||||
- Hub: real cost and charged amount per call; the markup default and per-licence override;
|
||||
a per-install month view with **cost, charged and profit**; the cap check before each call.
|
||||
- Hub: the AI proxy, metering, caps, warnings, an exchange-rate setting, and a per-install
|
||||
usage view for Joshua (alongside the existing install detail page).
|
||||
- A small **eval set** (example event descriptions, reports, notes, with what a good answer
|
||||
@@ -1017,6 +1045,7 @@ feature.
|
||||
| — | AI in 2.0 | The **headline feature of 2.0**: one-button helpers only (draft an event, summarise reports and feedback, draft messages, improve text) — no chat yet (2026-10-24) |
|
||||
| — | AI provider and key | One provider, **Claude** (Haiku 5.5 to start, for cost). Joshua provides the key; installs call AI **through the Hub**, which holds the key and meters usage (2026-10-24) |
|
||||
| — | AI cost limits | A **monthly rand cap per install**, set in the Hub per licence to match what the church pays; admins see their usage in Site settings → AI (2026-10-24) |
|
||||
| — | AI buttons and markup | AI buttons show only when the licence's monthly cap is **above R0**. When the cap is reached they stay visible but **disabled** until next month or until the cap is raised. Usage is charged at the real cost **plus a markup %** set in the Hub (a default, plus an override per licence). The markup covers small overruns and is the profit. The cap is counted in charged rand, and each call is checked against its worst-case cost before it's sent (2026-10-29) |
|
||||
| — | AI later | Ask AI (read-only, tools only), help/navigation assistant, actions with confirmation, more helpers, and long-term **self-hosted** AI behind the same Hub endpoint — not tied to versions (2026-10-24) |
|
||||
| — | POPIA: message kinds | Bulk messages are either **Event updates** (to registrants — still sent after unsubscribing) or **News & announcements** (marketing — opt-in, one-click unsubscribe). Every bulk email links to the preferences (2026-10-23) |
|
||||
| — | POPIA: existing users | Kept opted in to news (logged as "existing account"), asked once at their next login to confirm or opt out. New sign-ups choose with an unticked box (2026-10-23) |
|
||||
|
||||
Reference in New Issue
Block a user