Menu
Sign inDownload

Publish an engine

The package, trust tiers, channels and the publish API.

How engines are packaged, listed, downloaded and published. The hub owns this contract; Comms Array and engine authors build against it.

Version of this contract: 3 (30 Nov 2026). Changes from 2: every engine names the game it serves (engine.json game, required); hub.json describes that game; catalog entries carry game, game_name and official; the operator picks each game's official engine. Changes from 1 to 2: every version has a channel; the catalog and version-less downloads take ?channel=stable|beta (default stable); owners promote and demote versions.

Games and engines

A game can have more than one engine (ours, a community one). Everything players have belongs to the game: their stats and service record, leaderboards, world history, party cards, and in the app their pads, add-on permissions and personas. So players keep all of it when they move to another engine for the same game.

  • Each game has one official engine, picked by the operator. Its newest hub.json describes the game: stats, boards, the service record, the party dashboard and the world declaration. Uploads from any engine of the game are judged against it. The first engine published for a new game is its official engine until the operator picks another; the games the hub ships descriptions for (starcitizen, elite) start with their own engine.
  • An engine for a game that already exists keeps that game's value paths, action ids, situation names and stats names, so players' pads and records keep working when they switch.
  • Trust stays per engine: world data is taken only from official or verified engines, judged by the engine that sent it, not by its game.

Package

An engine package is a .zip (at most 50 MB, at most 2000 files, at most 200 MB unpacked) with at its top:

File
engine.jsonwhat the engine is and how it runs (below)
hub.jsonits stats, boards, service record and party dashboard description. Checked by the hub exactly like its own descriptions, plus the caps below
the coderun.python: one Python package folder <package>/__init__.py ...; run.program: the program file and anything it needs

Paths in the zip must be relative, use /, and contain no .., : or \. For a python engine every file other than engine.json, hub.json, README.md and LICENSE* must be inside the package folder.

engine.json

{
  "id": "mygame", "game": "mygame", "name": "My Game", "version": "1.2.0", "engine_api": 2,
  "author": "you", "summary": "Lap times and karts for My Game.",
  "processes": ["MyGame.exe"],
  "consent": {"terms_version": "1", "notice": "...", "reads": ["..."], "never": ["..."]},
  "input_rules": {"automation": "allowed" | "not_allowed" | "unclear", "text": "..."},
  "run": {"python": "ca_mygame"}
}

or "run": {"program": "bin/mygame-engine.exe", "args": ["--quiet"]}.

FieldRule
id^[a-z][a-z0-9_]{1,30}$; the engine's own id
gamerequired, same rule: the game it serves, and hub.json's id. Fixed at the engine's first publish
game_nameoptional, up to 60 characters: the game's name, when name is the engine's own
name1-60 characters
versionMAJOR.MINOR.PATCH with an optional -prerelease (e.g. 1.2.0, 1.3.0-beta.2); must be newer than every version already published for that id
engine_apiinteger 1-999: the engine link version it speaks (docs/engine-api.md in the agent repo)
authoroptional, up to 60 characters; shown in the catalog. "Comms Array" is reserved for official engines
summaryoptional, up to 200 characters; shown in the catalog
processes1-8 file names ending in .exe, no path; the programs that mean the game is running and the only windows that may get key presses
consentterms_version (1-20 chars), notice (up to 1000), reads and never (lists of up to 12 strings of up to 300)
input_rulesautomation one of allowed, not_allowed, unclear; text up to 1000
runexactly one of python (a package name ^[A-Za-z_][A-Za-z0-9_]{1,40}$ with <package>/__init__.py in the zip) or program (a relative path to an .exe in the zip) with optional args (up to 16 strings of up to 200)

Unknown fields are kept out of the catalog but don't fail the check (the agent reads the package itself).

hub.json caps (on top of the hub's own checks)

At most 128 KB of JSON; at most 100 counters, 16 dimensions, 16 details tables, 80 boards (boards + party boards), 20 board groups; text patterns (dimensions.*.pattern, details.*.key) at most 120 characters and without a quantified group ((...)*, (...)+, (...){n}) or back-reference, so no description can make the hub's pattern checks slow. Expressions are the hub's safe expressions only; no engine code runs on the hub.

World numbers (world.numbers in hub.json)

The public numbers on /world, worked out nightly per game build. At most 12, each {"id", "label" (≤ 60 characters), "rows": [grid rows a session must have sent], "format": "decimal2" | "duration" | "int"} plus one of:

  • "count": <event>, "per_hour": "session" | <change field>: how often a declared world event happens per hour of play, or per hour that change field held a value;
  • "median": "session_length": the median session length in seconds (sessions still going are left out).

The event and field must be in the same world section (and so sent to world at all). Optional numbers_title and numbers_about (≤ 400 characters each) head the page. Every session of a trusted world id counts, up to its close or, if it never closed (a crash, a dropped server), its last record; builds held for review ("new fields seen") are left out, and a number shows from floor players, marked "few reports" under few_reports_under (world settings).

Trust tiers

Each published version has a tier, signed into its signature:

TierWho
officialpublished with the hub operator's CI tokenmade and signed by us
verifieda developer's version an admin has reviewed (/admin/engines → Mark verified)made by someone else, reviewed and signed by us
unreviewedevery version a developer publishes, until an admin verifies that versionanyone's

A verified engine's next version is unreviewed until it is verified in turn: the signature only says "reviewed" about code we saw. The app shows the tier and asks for the "I trust whoever made this" step for an unreviewed version.

Channels: stable and beta

Each published version is on a channel, like the app's own builds:

Channel
betaevery version, when it is published
stablea version its owner promoted: the operator at /admin/engines for official engines, the developer at /me/developer for theirs

The owner can move a stable version back to beta (demote). Nobody else can change an engine's channels: admins don't promote developers' engines, developers can't promote official ones (403). Versions published before channels existed are stable. The channel isn't in the signature: it only decides what the catalog offers; the tier is what the app trusts.

Comms Array asks for the channel its own update setting is on: a player on stable sees only stable versions; on beta, the newest version of either.

Catalog

GET /v1/engines[?engine_api=N][&channel=stable|beta]

Public. The newest version of every listed engine in the channel, sorted by name:

{"engines": [
  {"id": "mygame", "game": "mygame", "game_name": "My Game", "official": true,
   "name": "My Game", "version": "1.2.0", "engine_api": 2, "tier": "unreviewed",
   "channel": "stable", "author": "you", "summary": "Lap times and karts for My Game.", "run": "python",
   "size": 48213, "sha256": "<hex>", "signature": "<b64>.<b64>",
   "published": 1764075600}
]}

game is the game the engine serves, game_name that game's name on the hub (from its official engine's hub.json; null for a game described only by a description built into the hub), official whether this engine is that game's official engine. The signature payload is unchanged (engine id, version, sha256, engine_api, tier).

channel: stable (the default) lists each engine's newest stable version, and only engines that have one; beta lists the newest version of either channel. Anything else is 400. The default is stable so apps from before channels (which install whatever the catalog lists) never get a beta version.

With ?engine_api=N (the highest engine link version the app speaks): per engine, the newest version in the channel whose engine_api ≤ N; when a newer version in the channel needs a newer app, the entry also has "latest": {"version": "1.3.0", "engine_api": 3} (show "waits for an app update"). Engines with no version the app can run are listed with only id, name, tier, author and latest. Every engine is listed either way, so the app can say which ones wait for an app update. An Authorization header is ignored here (the catalog is public).

Withdrawn engines (an admin took them down) are not listed and can't be downloaded.

GET /v1/engines/{id}/download[?version=V][&channel=stable|beta]

Public. Version V's zip, whatever its channel (the app asks for the version the catalog listed, and for roll-back); with no version, the newest version in channel (default stable). Content-Type: application/zip, Cache-Control: no-store, and

X-Engine-Signature: <b64url(payload)>.<b64url(ed25519 signature)>

payload is compact JSON with sorted keys:

{"engine_api": 2, "id": "mygame", "kind": "engine", "sha256": "<hex of the zip>", "tier": "unreviewed", "version": "1.2.0"}

signed with the hub's license key (GET /v1/license/pubkey, the key the app already trusts for licenses and add-ons). The app MUST check the signature, then kind == "engine", id, version, engine_api (against the zip's engine.json) and sha256 of the bytes it got, and take the tier from the payload, never from the listing. 404: unknown id or version, or withdrawn.

Publishing

Developer accounts and publish tokens

Anyone signed in to the hub is a developer: **/me/developer** creates a publish token (shown once, stored hashed) and revokes it, and lists the account's engines. At most 5 live tokens per account. Tokens start with cae_. A token can only publish; it can't sign in or read anything.

POST /v1/engines/publish

Body: the zip (Content-Type: application/zip), at most 50 MB. Authorization: Bearer <token>.

  • Developer token: the first publish of an id claims it for the token's account. After that only that account can publish it. Ids the hub ships descriptions for (starcitizen, elite) and ids published with the operator's token are reserved and can't be claimed. At most 10 ids per account. The version is unreviewed.
  • The game: anyone may publish an engine for a game that already exists (under their own engine id). It doesn't change that game's description or official engine. An engine's game is fixed: a version naming another game is refused (409). The first engine for a new game creates the game, as its official engine.
  • Operator token (HUB_PUBLISH_TOKEN, CI for official engines): publishes official versions of reserved or unclaimed ids; it can't publish over an id a developer owns.

Either way the new version is on beta until its owner promotes it. A publish script that checks whether the hub already has a version should read ?channel=beta (it lists the newest version of either channel).

Answers:

Status
200{"ok": true, "id", "version", "tier", "sha256", "claimed": true | false}
400refused: <reason>: not a zip, a bad engine.json or hub.json, unsafe paths, caps
401no or unknown token
403the id belongs to another account, or is reserved
409the version isn't newer than the newest published one, or names another game than the engine's
413over 50 MB
429over the rate limit: 10 publishes an hour per account, 30 an hour per address

Publishing a new version of a game's official engine makes its hub.json the game's description on the hub at once: its stats, leaderboards, service record and party dashboard work with no hub change. Another engine's hub.json is checked the same way, so the operator can make it official later, but doesn't describe the game until then. Boards and pages of a game whose official engine's newest version is unreviewed carry an "unreviewed" label.

Promote and demote

WhoWhere
a developer/me/developer → "Stable and beta"Promote to stable / Move back to beta on each of their engines' newest 5 versions; POST /me/developer/channel (id, version, op = promote | demote, CSRF)
an admin/admin/engines → "Official engines: stable and beta"the same for official engines; POST /admin/engines with op = promote | demote

Answers: 302 back to the page; 403 not the engine's owner (a developer's engine at /admin/engines, or someone else's at /me/developer); 400 unknown version or already on that channel.

What the hub keeps

Per game: its official engine. Per engine id: owner account (none for official), the game it serves, withdrawn flag. Per version: the zip on disk, its engine.json fields above, its hub.json, sha256, size, tier, channel, who published it and when. Publish tokens are stored as SHA-256 hashes. Logs carry engine id, version, tier and account id, never a token.

From the Comms Array source, commsarray-agent d615c4d.