agent 1.7.0 + contracts 1.23.0: a demo scenario seeds whatever the church has installed

- contracts 1.23.0: the seed-scenario job (church, scenario, optional adminEmail; 45 minutes),
  SEED_SCENARIO_JOB_MIN_AGENT 1.7.0.
- agent 1.7.0: seed-scenario -> `crosscode demo <church> --scenario <s>`; seed-demo for
  accounts and app, and --scenario passed on to every product.
- crosscode script: `crosscode demo <church> --scenario <s>` loads the scenario on every product
  the church has here (Accounts, Events, the Website, the App), skipping the rest; every
  installed release checked first; the first failure stops the rest and names what's out of
  step (loaded / skipped in the report). `crosscode demo <church> app` says the App's demo comes
  with App 1.0.0.
- Docs: HANDOVER, APP-1.0-PLAN, VERSIONS, CHANGELOG, agent What's New.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 16:25:31 +02:00
co-authored by Claude Opus 5.5
parent 7391f97cfa
commit 2e8e4c04ca
17 changed files with 408 additions and 42 deletions
+10
View File
@@ -13,6 +13,16 @@ Write for the person updating servers: what the agent can now do from the Hub, a
contracts version needs it. The developer log is the commit history of apps/agent.
-->
## 1.7.0
- **Demo scenarios.** The Hub (2.26.0 and later) can load a whole demo church on a demo client:
Accounts first, then Cross Events, the Website and the App, the same church and people in each.
It's one job: the server loads **whatever the client has installed** and skips the rest, so a
client with only Accounts and the Website gets both. Every product's release is checked first
(Accounts 1.9.0, Events 3.8.0, Website 1.8.0); if one fails part-way, the report says which
products are out of step. The agent also runs single demo jobs for Accounts and (from App
1.0.0) the Church App. Single-product demo data works as before.
## 1.6.0
- **Demo data for the Church Website.** The Hub (2.25.0 and later) can load one of the Website's
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@crosscode/agent",
"version": "1.6.0",
"version": "1.7.0",
"private": true,
"description": "The server agent: runs the crosscode script for signed jobs from Cross Code Hub, reports stats (docs/AGENT-1.0-PLAN.md)",
"license": "UNLICENSED",
+13 -3
View File
@@ -58,10 +58,20 @@ export function crosscodeArgs(job: agent.AgentJob, opts: { exportFile?: string }
if (job.args.restart) out.push("--restart");
return out;
}
case "seed-demo":
case "seed-demo": {
// 1.6.0: the Website's demo names the product; Events' (no product) keeps its old form.
return ["demo", job.args.church, ...(job.args.product === "website" ? ["website"] : []), "--profile", job.args.profile,
...(job.args.adminEmail ? ["--admin-email", job.args.adminEmail] : [])];
// 1.7.0: the App's and Accounts' too, and a demo scenario passed on (`--scenario`), so each
// product can tell a scenario load from a single one.
const a = job.args;
const product = a.product && a.product !== "events" ? [a.product] : [];
return ["demo", a.church, ...product, "--profile", a.profile,
...(a.scenario ? ["--scenario", a.scenario] : []),
...(a.adminEmail ? ["--admin-email", a.adminEmail] : [])];
}
case "seed-scenario":
// 1.7.0: a whole demo scenario. No product named: the script loads every product the church
// has on this server, Accounts first, and skips the others.
return ["demo", job.args.church, "--scenario", job.args.scenario, ...(job.args.adminEmail ? ["--admin-email", job.args.adminEmail] : [])];
case "export":
if (!opts.exportFile) throw new Error("export needs a file to write");
return ["export", job.args.church, ...(job.args.products ?? []), "--out", opts.exportFile];
+1 -1
View File
@@ -12,7 +12,7 @@ import { paths } from "./paths";
* the tools that are there; anything missing is null rather than an error.
*/
export const AGENT_VERSION = "1.6.0";
export const AGENT_VERSION = "1.7.0";
function run(cmd: string, args: string[], timeoutMs = 10_000): Promise<string | null> {
return new Promise((resolve) => {
+20
View File
@@ -52,6 +52,26 @@ describe("crosscode arguments for each job", () => {
expect(crosscodeArgs(parsed({ type: "seed-demo", args: { church: "hope", product: "events", profile: "small" } }))).toEqual(["demo", "hope", "--profile", "small"]);
});
it("seed-scenario 1.7.0: one job, no product named, so the server seeds whatever the church has", () => {
expect(crosscodeArgs(parsed({ type: "seed-scenario", args: { church: "demo2", scenario: "community-family" } }))).toEqual(["demo", "demo2", "--scenario", "community-family"]);
expect(crosscodeArgs(parsed({ type: "seed-scenario", args: { church: "demo2", scenario: "bold-youth", adminEmail: "jane@hope.test" } })))
.toEqual(["demo", "demo2", "--scenario", "bold-youth", "--admin-email", "jane@hope.test"]);
expect(() => parsed({ type: "seed-scenario", args: { church: "demo2", scenario: "bold-youth", products: ["website"] } })).toThrow();
});
it("seed-demo 1.7.0: the App's and Accounts' demos, and a scenario passed on to every product", () => {
expect(crosscodeArgs(parsed({ type: "seed-demo", args: { church: "hope", product: "app", profile: "community-family" } }))).toEqual(["demo", "hope", "app", "--profile", "community-family"]);
expect(crosscodeArgs(parsed({ type: "seed-demo", args: { church: "hope", product: "accounts", profile: "bold-youth", scenario: "bold-youth" } })))
.toEqual(["demo", "hope", "accounts", "--profile", "bold-youth", "--scenario", "bold-youth"]);
expect(crosscodeArgs(parsed({ type: "seed-demo", args: { church: "hope", product: "website", profile: "clean-campus", scenario: "clean-campus" } })))
.toEqual(["demo", "hope", "website", "--profile", "clean-campus", "--scenario", "clean-campus"]);
// Events keeps its old form (no product), with the scenario and the admin kept.
expect(crosscodeArgs(parsed({ type: "seed-demo", args: { church: "hope", product: "events", profile: "bold-youth", scenario: "bold-youth", adminEmail: "jane@hope.test" } })))
.toEqual(["demo", "hope", "--profile", "bold-youth", "--scenario", "bold-youth", "--admin-email", "jane@hope.test"]);
// A scenario's profile must be the scenario's for that product (the contracts refuse the job).
expect(() => parsed({ type: "seed-demo", args: { church: "hope", product: "website", profile: "bold-plant", scenario: "bold-youth" } })).toThrow();
});
it("env-read and env-set (1.3.0): crosscode env, each value its own argument", () => {
expect(crosscodeArgs(parsed({ type: "env-read", args: { church: "hope", product: "accounts" } }))).toEqual(["env", "hope", "accounts"]);
expect(crosscodeArgs(parsed({