Release events@2.2.0 and contracts@1.2.0
Events 2.2.0: the move into the monorepo and the crosscode script, plus AI use in tokens and the backend under /api. Contracts 1.2.0: token fields on the AI status. Agent phase 1d moves to contracts 1.3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -178,7 +178,7 @@ monorepo, listing every variable with its layer, whether it's required, and a de
|
||||
- **URLs are checked before and after.** Before: the form checks that the domain's DNS points at
|
||||
the central server and warns if not (the install still runs). After Joshua marks the proxy done:
|
||||
the Hub checks `https://<domain>/` (frontend answers), `https://<domain>/api/health` (backend
|
||||
answers with the right version; `/health` before Events 2.3.0) and that it reports the
|
||||
answers with the right version; `/health` before Events 2.2.0) and that it reports the
|
||||
`FRONTEND_URL` it was given.
|
||||
|
||||
**For Joshua to set per server before the first install:** the database settings and
|
||||
@@ -376,7 +376,7 @@ Set up in FastPanel: events.hope.co.za (Hope Family Church, Cross Events)
|
||||
|
||||
1. Add the site events.hope.co.za.
|
||||
2. Proxy:
|
||||
/api → http://127.0.0.1:20011 (backend; Events 2.3.0+, older
|
||||
/api → http://127.0.0.1:20011 (backend; Events 2.2.0+, older
|
||||
releases also need /uploads, /health, /docs)
|
||||
everything else → http://127.0.0.1:20010 (frontend)
|
||||
Pass the Host header and X-Forwarded-For / X-Forwarded-Proto: https.
|
||||
@@ -397,7 +397,7 @@ Central check: both ports are open in frps and only on 127.0.0.1.
|
||||
(lib/env.sh), ports given on the command line instead of picked.
|
||||
- `apps/events`: `env.template.json`, and the export (`crosscode export` calls a backend script
|
||||
that writes `crosscode.church-export/1`).
|
||||
- `packages/contracts` **1.2.0**: `crosscode.agent-job/1`, `crosscode.agent-report/1`,
|
||||
- `packages/contracts` **1.3.0** (1.2.0 went out with Events 2.2.0): `crosscode.agent-job/1`, `crosscode.agent-report/1`,
|
||||
`crosscode.agent-stats/1`, `crosscode.env-template/1`, `crosscode.church-export/1`.
|
||||
|
||||
**`events-hub` (Hub 2.1.0)**
|
||||
@@ -441,7 +441,7 @@ Central check: both ports are open in frps and only on 127.0.0.1.
|
||||
|
||||
## 14. Rolling it out
|
||||
|
||||
1. Contracts 1.2.0 → the `crosscode` script changes (with Events 2.2.0 out first) → agent 1.0.0
|
||||
1. Contracts 1.3.0 → the `crosscode` script changes (with Events 2.2.0 out first) → agent 1.0.0
|
||||
→ Hub 2.1.0, each released as usual (branch → merge → tag → push).
|
||||
2. On the central server: add `proxy_bind_addr = 127.0.0.1` to `frps.ini` if it's missing (check
|
||||
that each FastPanel site still answers), then join the central agent.
|
||||
|
||||
+3
-3
@@ -25,9 +25,9 @@ for each phase. They moved here from `hope-events/docs/` on 2026-11-05.
|
||||
|-------|------|-------|
|
||||
| 0 | contracts 1.0.0 / 1.1.0 | **Released** 2026-11-04 (`contracts@1.0.0`, `contracts@1.1.0`). Not published to a registry (decision 22): the Hub gets a packed release committed to its repo |
|
||||
| 1 | Hub 2.0.0 | **Released** 2026-11-05 (`events-hub` `v2.0.0`; `docs/HUB-2.0-PLAN.md` there). **Not deployed yet:** `events-hub/deployment.md` → "Upgrading to 2.0" (run `check-hub2` first). crosscode-site's address prices are merged, **not deployed yet** |
|
||||
| 1b | Cross Events 2.2.0: moves here as `apps/events`, `crosscode` script | **In progress.** Planned in [EVENTS-2.2-PLAN.md](./EVENTS-2.2-PLAN.md). **Steps 1–3 done 2026-11-12** (merged into `main`): history merged in under `apps/events` (from `hope-events` `e6c9670`), workspaces and one root lockfile with versions pinned to 2.1.1, same test results as 2.1.1 (711 backend tests, typecheck, both builds). **The `crosscode` script and `adopt` (§4–5) are written** (branch `feat/crosscode-script`, 2026-11-12; shellcheck and 47 bats tests pass, not yet run on a server). **Still to do:** VM testing (§6), the version bump and `events@2.2.0` tag, adopting each install, archiving `hope-events` (§7). Until then servers keep deploying from `hope-events` `v2.1.1`, and **Events work happens here** (`hope-events` is frozen; a hotfix there as 2.1.2 is cherry-picked into `apps/events`) |
|
||||
| 1c | Cross Events 2.3.0: authenticator app 2FA (TOTP + recovery codes) | TOTP not started (`TwoFactorMethod` enum in Events' `prisma/schema.prisma`). **Done on branches, 2026-11-17, not merged:** AI use in tokens (`feat/ai-tokens` here, in `events-hub` as 2.0.1 and in crosscode-site) and the backend under `/api` (`feat/api-prefix`) |
|
||||
| 1d | Agent 1.0.0 + Hub 2.1.0 (+ contracts 1.2.0): server agent, installs / scheduled updates / uninstalls from the Hub, server stats | **Planned** 2026-11-12 in [AGENT-1.0-PLAN.md](./AGENT-1.0-PLAN.md) (ROADMAP decisions 27–37). Starts after 1b; can run alongside 1c |
|
||||
| 1b | Cross Events 2.2.0: moves here as `apps/events`, `crosscode` script | **In progress.** Planned in [EVENTS-2.2-PLAN.md](./EVENTS-2.2-PLAN.md). **Steps 1–3 done 2026-11-12** (merged into `main`): history merged in under `apps/events` (from `hope-events` `e6c9670`), workspaces and one root lockfile with versions pinned to 2.1.1, same test results as 2.1.1 (711 backend tests, typecheck, both builds). **The `crosscode` script and `adopt` (§4–5) are written** (branch `feat/crosscode-script`, 2026-11-12; shellcheck and 47 bats tests pass, not yet run on a server). **Tagged `events@2.2.0` on 2026-11-17, before the VM testing (Joshua's call), with two additions: AI use in tokens and the backend under `/api` (Hub `v2.0.1` and crosscode-site `v1.2.0` released with them).** **Still to do:** VM testing (§6) of the tagged release, adopting each install, archiving `hope-events` (§7). Until then servers keep deploying from `hope-events` `v2.1.1`, and **Events work happens here** (`hope-events` is frozen; a hotfix there as 2.1.2 is cherry-picked into `apps/events`) |
|
||||
| 1c | Cross Events 2.3.0: authenticator app 2FA (TOTP + recovery codes) | TOTP not started (`TwoFactorMethod` enum in Events' `prisma/schema.prisma`). |
|
||||
| 1d | Agent 1.0.0 + Hub 2.1.0 (+ contracts 1.3.0): server agent, installs / scheduled updates / uninstalls from the Hub, server stats | **Planned** 2026-11-12 in [AGENT-1.0-PLAN.md](./AGENT-1.0-PLAN.md) (ROADMAP decisions 27–37). Starts after 1b; can run alongside 1c |
|
||||
| 2 | Cross Events 2.4.0: protocol v2, Linked products, event feed, `packages/seo` | Not started. Events keeps speaking protocol 1 until then |
|
||||
| 3–7 | Accounts 1.0.0 → Website 1.0.0 → Events 3.0.0 → App 1.0.0 → App 1.x | Not started |
|
||||
|
||||
|
||||
+5
-5
@@ -613,9 +613,9 @@ Planned in [AGENT-1.0-PLAN.md](./AGENT-1.0-PLAN.md). In short:
|
||||
|-------|---------|------|----------------|
|
||||
| 0 | contracts 1.0.0 | `crosscode.event/1`, `crosscode.church/1`, `crosscode.identity/1`, Hub protocol v2: schemas, generated JSON Schema, docs, sample payloads, the monorepo set up. **Released 2026-11-04** | Everything else depends on them |
|
||||
| 1 | **Hub 2.0.0** | Cross Code Hub: products, licence per product, per-customer billing with bundles, protocol v2 (v1 still accepted), sibling discovery, AI usage per product, **releases per product with requirements** (§5), contracts as a committed file (§2). **Released 2026-11-05** (crosscode-site address prices merged) | Must exist before a second product is sold, and before Events releases come from the monorepo |
|
||||
| 1b | **Cross Events 2.2.0** | **Moves into the monorepo** as `apps/events`, with its git history (merged in, not copied); its packages become workspaces; the **`crosscode` script** (`deploy`, `status`, `install`, `adopt`; §8) replaces `scripts/deploy.sh` and `scripts/install.sh`; every install moved with `crosscode adopt`; `hope-events` archived. No feature changes, so a problem is clearly the move | Before more products, so every product is released and deployed the same way from the start |
|
||||
| 1c | **Cross Events 2.3.0** | **Authenticator app 2FA** (TOTP) next to email and WhatsApp, with recovery codes; admins can see which method each staff account uses. Also (decided 2026-11-17): **AI use shown in tokens**, never rand, outside the Hub (needs Hub 2.0.1); **everything the backend serves under `/api`**, so a site and its API share one address and one proxy rule | Independent and useful now; the Accounts migration later carries it over |
|
||||
| 1d | **Agent 1.0.0 + Hub 2.1.0** (contracts 1.2.0) | **Server agent** on every server (polls only, signed jobs, runs the `crosscode` script); Hub: Servers page with stats and alerts, server configuration, frp port list, New install with a choice of server, scheduled / emergency / batch updates with notice to the church, uninstall with an encrypted JSON export, emailed reports. [AGENT-1.0-PLAN.md](./AGENT-1.0-PLAN.md) | Right after 1b (it runs the `crosscode` script), so every new church from then on is installed from the Hub. Can run alongside 1c |
|
||||
| 1b | **Cross Events 2.2.0** | **Moves into the monorepo** as `apps/events`, with its git history (merged in, not copied); its packages become workspaces; the **`crosscode` script** (`deploy`, `status`, `install`, `adopt`; §8) replaces `scripts/deploy.sh` and `scripts/install.sh`; every install moved with `crosscode adopt`; `hope-events` archived. Planned with no feature changes; two small ones were added on 2026-11-17 (decided by Joshua): **AI use shown in tokens**, never rand, outside the Hub (needs Hub 2.0.1), and **everything the backend serves under `/api`**, so a site and its API share one address and one proxy rule. **Tagged 2026-11-17, before the VM testing** | Before more products, so every product is released and deployed the same way from the start |
|
||||
| 1c | **Cross Events 2.3.0** | **Authenticator app 2FA** (TOTP) next to email and WhatsApp, with recovery codes; admins can see which method each staff account uses. | Independent and useful now; the Accounts migration later carries it over |
|
||||
| 1d | **Agent 1.0.0 + Hub 2.1.0** (contracts 1.3.0) | **Server agent** on every server (polls only, signed jobs, runs the `crosscode` script); Hub: Servers page with stats and alerts, server configuration, frp port list, New install with a choice of server, scheduled / emergency / batch updates with notice to the church, uninstall with an encrypted JSON export, emailed reports. [AGENT-1.0-PLAN.md](./AGENT-1.0-PLAN.md) | Right after 1b (it runs the `crosscode` script), so every new church from then on is installed from the Hub. Can run alongside 1c |
|
||||
| 2 | **Cross Events 2.4.0** | Reports `product: "events"` (protocol v2), **Linked products**, the event feed (publish + show events from siblings), `packages/seo` (§11) with canonical links for imported events | Small; ready for when the Website exists |
|
||||
| 3 | **Accounts 1.0.0** | OIDC provider, sign-in, 2FA (email, WhatsApp, authenticator app), password reset, consent and notice, export / delete fan-out, admin, install script | The Website is built on it from day one |
|
||||
| 4 | **Church Website 1.0.0** | Public site with the **four templates** (§6), admin, simple events + feed, SEO (§11), Hope Family Church as the first church, then a second test church on a different template to prove it repeats | More churches need a website than an app; it also covers the "website only" case |
|
||||
@@ -636,8 +636,8 @@ At the end of each phase, update it in the same sitting and deploy it (its `DEPL
|
||||
|-------|--------------------------------|
|
||||
| 0 contracts | Nothing |
|
||||
| 1 Hub 2.0.0 | Bundle discounts (15% / 25%) and the address add-on (own domain R0 · Cross Code address R10 · domain included R25) in `src/data/pricing.mjs`, worded so it's clear the Website and App are still coming. Legal pages if billing terms change |
|
||||
| 1b Events 2.2.0 | Nothing (the move doesn't change what Cross Events does) |
|
||||
| 1c Events 2.3.0 | Authenticator app 2FA in the Cross Events feature list (`src/data/cross-events.mjs`) and the security / POPIA wording. (The AI allowance in tokens was done ahead, on branch `feat/ai-tokens` in crosscode-site, 2026-11-17) |
|
||||
| 1b Events 2.2.0 | The AI allowance in tokens instead of rand (`src/data/cross-events.mjs`, the brochure). Done in crosscode-site 1.2.0 |
|
||||
| 1c Events 2.3.0 | Authenticator app 2FA in the Cross Events feature list (`src/data/cross-events.mjs`) and the security / POPIA wording. |
|
||||
| 1d Agent 1.0.0 + Hub 2.1.0 | Nothing (it changes how installs are run, not what churches buy) |
|
||||
| 2 Events 2.4.0 | "Works with the Church Website and App" (event feed, Linked products) on the Cross Events page, as "coming" until those ship |
|
||||
| 3 Accounts 1.0.0 | "One sign-in for all your church's products" on the Products page. Accounts isn't sold, so no page or price of its own |
|
||||
|
||||
@@ -214,14 +214,14 @@ X-Hub-Install / X-Hub-Timestamp / X-Hub-Signature (as in §3)
|
||||
active (suspended, revoked, or past its grace days), or the Hub's AI isn't set up.
|
||||
- **`capReached: true`** — show the buttons **disabled** ("This month's AI allowance is used up — it
|
||||
renews on 1 December"). Reached means there isn't room left for even a small call.
|
||||
- **Churches see tokens, never rand** (Hub 2.0.1, Cross Events 2.3.0). `usedInputTokens` /
|
||||
- **Churches see tokens, never rand** (Hub 2.0.1, Cross Events 2.2.0). `usedInputTokens` /
|
||||
`usedOutputTokens` are this month's tokens over all the church's installs (input counts cached
|
||||
prompt tokens). `capInputTokens` / `capOutputTokens` are an **estimate** of the allowance: what half
|
||||
the cap buys as input and half as output, at the current model price, exchange rate and markup,
|
||||
rounded down to a thousand. `usedPercent` is exact (it's worked out in rand). Installs show the
|
||||
tokens and the percentage, and don't pass the cents on.
|
||||
- `capCents` / `usedCents` are cents (rand) as **charged** to the church, with fractions (a call costs
|
||||
a fraction of a cent), for the Hub and for installs before Cross Events 2.3.0. The month is South
|
||||
a fraction of a cent), for the Hub and for installs before Cross Events 2.2.0. The month is South
|
||||
African time; `renewsOn` is the 1st of the next month.
|
||||
|
||||
### A helper call
|
||||
|
||||
Reference in New Issue
Block a user