Found in the VM test: the new install's tunnels never opened, because
frpc only reads admin_addr when it starts, so the first reload failed.
That first time (and whenever a reload fails), frpc is restarted under
systemd and the report says so; later changes reload as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without it a site installed from a staging Hub (or the VM test's Hub)
can't check its licence. Blank in production, so it isn't written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found in the VM test: npm ci -w packages/contracts -w apps/agent skipped
the monorepo root's devDependencies (tsup, typescript), so the agent
couldn't be built. --include-workspace-root brings them in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found in the VM test: Prisma records a failed migration and then refuses
every later migrate deploy (P3009), so one broken release left a church
unable to update. On rollback, failed migrations the previous release
doesn't have are marked rolled back (prisma migrate resolve); the
backup still has the database as it was.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found in the VM test: adopt refused events@2.2.0 because the AI tokens
migration made it into the release, and adopt only moved installs with
no migrations. Now the migrations the release has and the old install
doesn't run after the backup, while neither version runs; a failure
starts the old install again. They're recorded (EVENTS_ADOPT_MIGRATIONS)
so adopt --undo can still go back past them (they only add columns).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apps/agent (docs/AGENT-1.0-PLAN.md §3-4, §10): listens on nothing; checks
every job (pinned Hub key, server, time window, replays for 90 days,
type per mode, strict arguments) before running crosscode with an
argument array; opens the sealed config into a root-only file only for
the job; redacts log lines; keeps unsent reports in an outbox; encrypts
exports before upload; check-ports on the central server (read-only);
self-update with automatic revert. One bundled dist/cli.js, a systemd
unit and the install script that joins a server with a one-time token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Every command takes --json (crosscode.script-report/1 on stdout, the
log on stderr) and --config (the .env values by layer, from the agent).
- .env files come from the release's env.template.json (lib/envtpl.js):
written whole on install; on deploy only new variables are appended,
and a new required one with no value stops the deploy at the checks.
- install --frp: Hub-given ports, a marked frpc.ini block (backup,
frpc verify, reload; [common] admin lines added once), no nginx.
A database on another server via DB_ADMIN_URL. Refuses an existing
database or role. Everything the run made is removed if it fails.
- restart, export (crosscode.church-export/1 ZIP), uninstall (final
backup, uploads and .env kept 30 days) and purge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- apps/events/env.template.json (crosscode.env-template/1): every .env
variable with its layer (server, defaults, install, generated).
- scripts/export-church.ts writes crosscode.church-export/1 (export-only
references, no internal ids or secrets) for crosscode export.
- Installs made from the Hub register by themselves on first start when
HUB_LICENCE_KEY is set (retries while the Hub is unreachable).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jobs of fixed types with strict argument schemas, signed by the Hub with
Ed25519 over canonical JSON. Agent requests signed with the server's
Ed25519 key. Config sealed to the server's X25519 key (X25519 + HKDF +
AES-256-GCM; Node has no XSalsa20). Exports encrypted with a key that
only travels in the download link.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The site and its API can share one address with one proxy rule (/api to
the backend, everything else to the frontend). Status page at /api (/
redirects), /api/health, /api/docs/v2, /api/uploads. Stored upload
paths stay /uploads/… and are given out as /api/uploads/…. Old paths
still answer (/health, /uploads) or redirect (/docs, /docs/v2), so
two-address sites keep working. DEPLOYMENT.md and the agent plan
describe the single rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Site settings → AI, the usage tables and the 80% email show input/output
tokens and the percentage; the rand amounts from the Hub are dropped on
arrival. AiCall stores each call's tokens (migration ai_tokens). v2
/ai/status and /ai/usage carry tokens instead of cents. Needs Hub 2.0.1
for the token figures; older Hubs show the percentage only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One script for installing, updating and moving church installs, replacing
hope-events' scripts/deploy.sh and install.sh:
- deploy <church> [events] / --every-church, with --version, --main, --check
and --allow-local-changes: checks every product first (files changed by
hand, Node, release requirements from WHATS-NEW.md headings), then each
product in order with backup, checkout, install, migrate, build, PM2 reload
and a /health version check; a failure rolls that product back and stops.
- status [<church>]: checked-out and latest release, /health, and the old
folder kept after adopt.
- install <church> --products events --domain <address>: a new church under
/var/www/sites/<church>, writing church.env.
- adopt <church> --events-dir <old> builds the monorepo checkout next to the
running install and switches PM2 over; adopt --undo goes back to it.
Product hooks live in scripts/products/events.sh. shellcheck (lint:scripts)
and 47 bats tests (test:scripts) are part of npm run check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Workspaces: apps/events/backend and apps/events/frontend; apps/events itself
excluded (npm doesn't install node_modules for a workspace nested in another).
Its dev tools (Playwright, axe, concurrently) move to the root.
- Packages renamed @crosscode/events, -backend, -frontend; nested lockfiles removed.
- allowScripts moved to the root (npm ignores it in workspaces), same choices.
- Direct dependencies that moved pinned to their 2.1.1 versions in root overrides;
@sentry/node pinned only inside the backend.
- Same results as 2.1.1: 52 suites / 711 backend tests, typecheck, both builds.
- EVENTS-2.2-PLAN §2 and HANDOVER updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
History rewritten under apps/events/ (git filter-branch). Commit hashes changed;
the originals stay in the archived hope-events repo. Old v… tags are not brought over.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent on every server runs installs, scheduled/emergency updates and
uninstalls on signed jobs from the Hub, polls only (no listening port),
appends to frpc.ini in marked blocks, builds .env files from per-server
config in the Hub. FastPanel and DNS stay manual (emailed instructions).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ROADMAP-v3 decisions 21-24: Cross Events moves into crosscode-platform
(2.2.0); one crosscode script deploys Accounts plus the products named;
the Hub tracks releases per product with requirements; the Hub gets the
contracts as a committed file, not from the package registry. Cross Events
versions in the build order move up by one. HANDOVER updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- schemas/: JSON Schema (draft 2020-12) generated from the zod schemas by
npm run build (scripts/json-schemas.cjs), exported as
@crosscode/contracts/schemas/*
- Test: files match the zod schemas, every sample passes them (Ajv)
- Version 1.0.0, CHANGELOG and README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crosscode.event/1 and crosscode.event-feed/1 (feed, event.changed
webhook), with session and registration rules; parseEventFeed skips
and reports bad events instead of failing the whole feed.
- crosscode.church/1: branding, campuses, service times, contact, links.
- crosscode.identity/1: sign-in claims and the user.updated /
user.deleted / user.export back-channel calls and replies.
- Sign-in return helpers (isSafeReturnPath, encodeState/decodeState,
isRegisteredRedirectUri) so every product returns people to the page
they came from in the same safe way.
- Hub protocol v2: product on register/heartbeat, stats per product,
install public key, linked products, customerId/product in licences.
- @crosscode/contracts/signing (Node only): the Hub's HMAC scheme.
- Samples for every contract in samples/, checked by the tests (120).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm workspaces (packages/*, apps/*) with shared TypeScript, ESLint and
Jest setup and `npm run check`. @crosscode/contracts builds to CommonJS
and ESM (tsup) with the crosscode.<name>/<major> schema-name helpers.
packages/ui and apps/{accounts,website,app} are placeholders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One install of each product per customer; House of Prayer booking
defaults; email and WhatsApp only (no push); Accounts hidden from
members. Pricing: Website R99 with 5 GB plus storage add-on, App from
R99, address once per church (own domain, crosscode.co.za address R10,
domain included R25). Authenticator app 2FA as Cross Events 2.2.0.
Handover now points at ROADMAP-v3; nothing left open in ROADMAP-v2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan for selling three products from one Hub: shared users through a
per-church Accounts service, event sync in any direction on one shared
format (crosscode.event/1), PM2 installs per product per church.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Send now and Remind answer straight away with who they're going to and
queue the feedback-send task; the Feedback page refreshes to show progress.
- One-off background tasks (enqueueTask in src/jobs/index.js): pg-boss with
retries, or in-process after the response when the queue is off.
- Reminders are claimed with the 24-hour rule, so two tasks at once never
remind the same person twice.
- Tests: tests/tasks.test.js, tests/feedbackPage.test.ts, e2e/feedback.spec.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>