How mate reaches users. Each step names the file that owns its detail.
- CI. CI runs lint/format, typecheck, build and T1 on
main,kh-bisect/**and pull requests (a newer push cancels older runs except onmain). Other test suites and test machinery run only on a manual dispatch of CI or through akh-bisect/**manifest naming them. - Landing.
node scripts/land.tslands the commit checked out when it starts onmain. First, without the lock, it fetches, rebases ontoorigin/main, checks the sentence delta and that.mate-hq-refis on mate-hq'smain, numbers the branch's sentences and runsscripts/gate-changed.ts --fullundernice: every refusal those steps give (conflict,sentences,pin,env,gate) comes without the lock. Then it queues for a lock shared by every worktree. Holding it, it fetches again: whenorigin/mainhas not moved it pushes the tree it gated; otherwise it rebases, repeats the checks and the numbering, and gates again with--passed <the commit its gate passed>, which runs the always-run stages and only the stages that read a filemain's new commits changed (every stage when a gate selection input changed), then fast-forward pushes, printingLANDED <sha>. Nothing carries the first gate's verdict but that commit id inside the landing's own process. It needsMATE_HQ_CHECKOUTset to a mate-hq clone; a refusal (land: refused <class>: <reason>, non-zero exit) pushes nothing unless its reason says the push may have landed; agaterefusal names each red stage with its full log (gate red on <tip>: <stage> (<log path>)[; …], the gate's own last stderr line). The line before the last one island: waited <s> s, held the lock <s> s. When a rebase, before the lock or under it, changesscripts/land.tsor ascripts/module it imports, the landing lets go of the lock and its place in the queue and runs the rebasedscripts/land.tsin its place, with the same arguments; that run's last line and exit code are the landing's. A waiting landing whose commits do not merge with the localorigin/mainis refusedconflictwhile it waits. The command owns the queue, so a lane, a person and a script land alike and none adds its own lock or clock: it waits for the lock as long as another landing holds it (a holder that died releases it), and holding it has no time limit. SIGINT or SIGTERM, queued or landing, ends it asinterruptedwithin 5 s, so a caller that stops it waits 5 s before SIGKILL. Once the push has started, origin decides: when itsmaincontains the pushed tip, the landing printsLANDED <sha>whatever stopped it. A lock directory that names no holder (no landing makes one) is refusedlockwith its path, to be removed once no landing runs. The landing checks the branch's sentence diff and numbers its lane-local ids inside the rebased branch's last commit (amended, never a commit of its own, so a landing pushes only the branch's commits). The gate covers the numbered tip, and each<unit>: <old> → <new>is printed to stderr and added to that commit's body; a landing that does not land leaves its branch on its own rebased commit, before the numbering. - Hosted web client. A
web-v*tag deploys https://mate.zerops.io throughzerops.yml'sprodsetup. A successful CI run onmainruns the release cutter for its commit automatically. For a minor release or a chosen greenmaincommit, run Release hosted web onmainin GitHub Actions or usenode scripts/release-web.tswith--minoror--from-sha <sha>(--dry-runprints the plan). The script usesgh; setMATE_GHto a release-token wrapper if needed. It requires the same green CI verdict as the server release, skips a commit already included in a web tag, and printsnothing to releasewhen no web build input changed. Configure the production web service's Zerops pipeline trigger to New Tag with regex^web-vand setupprod. Keepmainreleasable; never break signing in with a Zerops account. - Staging web.
zerops.yml'sstagingsetup builds a test target's web (alfa, the standing test environmentsenv-N) against that target's HQ, named by the web service's variableMATE_HQ_URL(VITE_HQ_ORIGIN); Mates born from it pinT3CODE_ZEROPS_HQ_ORIGINto that HQ. It runs at its service'szeropsSubdomain; the build refuses a service without either. Deploy it from a checkout withzcli push -P <project id> -S <web id> --setup staging. From a linked worktree add--workspace-state clean(zcli's default state writes a temporary index into.git, which is a file there); it pushesHEAD. - Dev environments' web.
zerops.yml'sdevsetup serveshttps://mate.<host>of each dev environment, one service per environment, named after it. Deploy a branch with the manual Deploy dev Mate workflow (.github/workflows/deploy-dev.yml). - Design harness. Every
apps/web/design*.htmlpage over its fixtures, listed at/design/and in the kit at/kitas its flows: the dev server always serves it, andprod,staging,devand a Mate'spreviewbuild it beside the app (VITE_DESIGN_HARNESS=beside). It reads no account and calls no server. Theharnesssetup builds it alone, in place of the app (VITE_DESIGN_HARNESS=alone): a static place to look at states with no account and no Mate. Deploy that from a checkout withzcli push -P <project id> -S <service id> --setup harness; nothing deploys it by itself. - Hosted client's service worker.
prodandstagingbuild withVITE_APP_SHELL_WORKER: app-shell:/sw.jsanswers every load with the origin's page, so the first load after a deploy runs it, and keeps that page with its files behind it; the kept page answers only when the origin cannot (offline, an error status). To retire it, set the variable toretireand deploy:/sw.jsbecomes a worker that clears its caches and unregisters on each browser's next navigation. Keep that deploy up; deleting the variable or/sw.jsleaves installed workers in place. - Shared production HQ. Deployment is owned by the private
zeropsio/mate-hqrepository. - Mate server release.
node scripts/release-mate.ts(--minorwhen the client's compatibility floor rises,--dry-runprints the plan). It calls GitHub throughgh; setMATE_GHto use a wrapper that holds the release token instead. zcp installs the latest stable release in containers by itself. Amaincommit may be released once its newestci.ymlrun onmainhas completed with every required job green (checkJobIdsinscripts/ci-blame.ts, the checks Release Smoke's verdict demands); a red informative job (tests, smokes, mobile) does not hold it. A missing run, a run still in progress and a required job not green are each refused with their own words. The release workflow asks the same verdict (node scripts/ci-blame.ts --release-verdict), and the lockfile policy check is part ofCheck. A source that changed no server artifact input since the last release (the sources the published artifact's sourcemaps name, plus the build tooling inscripts/lib/server-artifact-inputs.ts) cuts no release: the script printsnothing to releaseand exits 0; version-only edits never count.--from-sha <sha> --would-releaseprintsreleaseif the source needs a tag or already has one, andno-releaseif no server artifact input changed. It cuts, tags and pushes nothing. Av*tag on origin at the source or its version bump prevents tagging that source again. A release run waits for that tag's successful publication and checksum verification, including a tag another clone pushed. A superseded tag uses its own manifest. Only the newest tag is eligible for a workflow rerun. A run that may cut a release holds<git common dir>/mate-release.lockuntil it ends; a second run from the same clone or one of its worktrees printsanother release holds <path>; nothing cutand exits 1. Between clones or machines the tag push decides which tag is verified. - Install check against a staged release. Before promoting a release, run zcp's live seam case on
an e2e container that has Mate enabled (
make e2e-deployin zeropsio/zcp,ZCP_HOSTnames the service):ZCP_E2E_MATE_RELEASE=https://github.com/zeropsio/mate/releases/download/v<version>/stable.json /var/www/e2e-test -test.run TestMateInstall_Release_Serves -test.v -test.timeout 600s. It installs that release through download → SHA-256 → install and waits formate serveto be ready. Red means the release does not install or itsserverejects the launch argv or environment: do not promote it. The release stays installed on that container either way. - Unreleased server build in a running container.
eval/scripts/mate-dev-push.sh {zcp|mate|all}in azeropsio/zcpcheckout;MATE_REPOnames this checkout when it is not at the script's default. It needs the project VPN and an explicitEVAL_REMOTE_HOST. It is not a release: without a dev pin a dev Mate build stays only until a release newer than its base is known.zcp mate pin --for <duration> --reason <text>keeps every dev build in the container (24 h by default, at most 7 days, the reason is required);zcp mate pin --endremoves it andzcp mate pinshows it. A container restart replaces a dev zcp with the latest release whatever the pin says, but the pin, kept across the restart, still covers a dev Mate; a redeploy loses the bundles and the pin (zeropsio/zcp:docs/spec-mate.md§2.1a, §2.6).