What runs today
Continuous integration. Every test runs once per version, in the ship's
gate: the ship pushes one commit to a ready/<lane>-<sha8> branch, gate.yml runs
the API suite on both stores, the frontend suite, and a browser suite that
clicks through the running app the way a person would, on GitHub's runners, and
main moves only when all of it is green (ADR-098). A change that fails any of
them never reaches main. Since 1.0.5.4 the checks run
side by side: a job for the .NET side on SQLite, one for every pass on the
Cosmos DB account, one for the node checks and two for the browser suite, and a
gate job that folds their reports into one and gives the verdict (ADR-098, the
addendum of 1.0.5.4). The whole of every suite runs there once; a lane runs only
the suite its change touches before it pushes. Every result, test by test, ships with the version and is on
the Admin tab. The same suites then run again on GitHub's runners for every
push to main, where anybody can read the result without a login, and for a
pull request from anybody else, which has had no gate. Every one of those jobs
installs .NET through one step, .github/actions/dotnet, which tries the
download twice and then builds with the runner's own .NET SDK when it satisfies global.json, so a failed
download cannot turn a good version red (ADR-068, the addendum of 1.0.4.72).
A ship is a push of ready/<lane>-<sha8>, numbered at landing (ADR-137, One traffic cop for
main). The lane leaves the version, the date and the record number as placeholders; the Gate run's
first job, the traffic cop, rebases the commit onto main inside the gate's group, fills them (main's
top line plus one) and hands the filled commit to every later job, and the lane reads "landed",
"skipped" or "red gate" on its own commit. The steps are in CLAUDE.md, Shipping; what follows still
describes the gate and the promote, which the cop leads. Until 1.0.5.99 a ship was a push of
gate/<version>-<lane>-<sha8>, numbered on the laptop under the gate lock; that path is closed.
From 1.0.4.101 no machine has to stay
on for a version to ship (ADR-098, the addendum of 1.0.4.101). When the gate
and The Shed's suites are both green, the same run promotes itself: its
promote job runs scripts/promote.sh, which checks the version and the locked
resume, writes the results file and the README's figures from the run's
reports, folds them into the commit and fast-forwards main, never by force.
The run then calls Deploy and Deploy Render on that commit and starts CI on
main for it, and ends when the two deploys end, so the next gate starts at
live.
The reads after the roll are a run of their own (ADR-098, the addendum on
the gate freeing at live). .github/workflows/after-roll.yml starts when a Gate
run completes green, reads the one small artifact the promote job leaves when
it moved main (the commit, the version, whether the Function changed, whether
the push was the roll), and ends green doing nothing when there is none. It
waits for the push's deploys when a personal token made the push, starts the
edge's move, deploys the Function when the version touched it, reads both names
after the roll, reads CI on main for the commit to its end (starting it only
when no CI run names the commit), closes the gate's pull request and deletes the
gate branch, and runs Lighthouse on the promoted commit, report-only. It has its
own concurrency group, so the next gate runs while it reads. Its run's name
carries the version and the commit, and CI's run is named CI <commit>:
ci.yml takes the commit as an input by hand and checks it out in every job,
because a run started on main otherwise tests whatever main's head is.
The line-stop: main is proven before the next promote. Before it writes
anything, scripts/promote.sh needs, for origin/main's commit, the newest CI
run named for it and the newest after-roll run named for it and main's
version, each completed and green; runs are found by those names, never by
their head commit. A run missing or still running is waited on up to twenty
minutes (LINE_STOP_SECONDS); in the gate a wait that runs out ends GREEN with
promoted=false and a notice naming what it waited on, and the holder promotes
by hand once main is proven, so a slow main never costs a second gate. By
hand the same wait refuses and names the command that starts what is missing.
A red run refuses, unless the version's commit message carries
Fixes-main: <main's sha>: a red main must not refuse its own fix, and the
gate has tested the fix in full. A main commit from before after-roll.yml
existed is proven by CI on main alone. The promote job's cap is thirty
minutes, to hold the wait.
A version that changes a workflow needs more than the run's own token,
which GitHub never lets write to .github/workflows (ADR-098, the addendum of
1.0.4.119). With the repository secret PROMOTE_TOKEN, a fine-grained personal
token with Contents and Workflows write, the promote job pushes main itself;
and because a personal token's push starts the workflows the run's own push
would not, that push is the roll, so the gate's two deploy jobs skip and the
after-roll waits for the push's own Deploy and Deploy Render runs and reads the
push's CI run. With no such secret the promote job ends GREEN with
::notice::this version changes a workflow: promote it by hand with scripts/promote.sh, moves nothing, and the deploys skip, because a gate that
found nothing wrong must not send a failure email; a person then promotes the
run by hand, naming it:
raw=$(mktemp -d) && gh run download <run> -n gate-raw -D "$raw" && { gh run download <run> -n coderabbit-raw -D "$raw" || rm -f "$raw/coderabbit.json"; } && bash scripts/promote.sh "$raw" <gate seconds> <version> <run>.
No Gate run starts the after-roll for a version promoted by hand, so promote.sh
starts it right after its push, or names the one command:
gh workflow run after-roll.yml --ref main -f sha=<sha> -f version=<version>.
The number is filled at landing, by the traffic cop (ADR-137, One traffic cop for main). A lane builds its
one commit on origin/main with the placeholders for the version, the date and the record number where the
numbers go (CLAUDE.md, Shipping, spells them), and never fills them itself:
git fetch origin && git rebase origin/main
GATE_LANE=<lane> bash scripts/preflight.sh
git push origin HEAD:refs/heads/ready/<lane>-$(git rev-parse --short=8 HEAD)
bash scripts/gate_pr.sh open ready/<lane>-<sha8>
gh run list -w Gate -b ready/<lane>-<sha8>
The Gate run's first job, cop, runs the moment the run holds the gate's concurrency group (queue: max, every
pending run kept in line, the order GitHub's and not promised). scripts/cop.sh skips a branch that is not one
commit off main, whose changelog top line is already a number, or whose gate.yml is older than main's; it lifts the
lane's changelog line out, gives the changelog, .github/quality-ratchet.json and the version card main's side,
rebases the rest onto origin/main (a conflict anywhere else is a skip), puts the line back on top of main's
newest and runs scripts/fill_version.sh, which fills the version (main's top line plus one), today's date in
America/Chicago and the next free record number (in a file's name too), redraws the version card, tightens the
ratchet and amends. The filled commit leaves as a git bundle in the run's filled artifact, and every later job
checks it out with .github/actions/filled, so every check tests the commit that ships. A skip tested nothing
and ends the run green.
The lane reads what became of its branch on its own commit, the status named cop that
scripts/cop_status.sh posts: "landed as , main ", "green as , needs a hand promote",
"red gate: ; " or "skipped: ", each linked to its run. Anything but landed is
the lane's to fix and push as a new ready branch; nobody retries for it. The landing check (ADR-098, the addendum
of 1.0.5.233): promote.sh folds the run's results into the tested commit, then runs the tests that read a folded file on
that commit (scripts/landing_check.sh: the em dash scan, the xUnit reader classes on SQLite and all of Vitest)
before main moves, and a red one refuses with main where it was. Its status reads "red gate as : landing;
: ": a lane whose own change touched that test, a reader or a script the fold runs fixes it and
pushes again; otherwise the fold is broken for every lane, a retry fails the same way, and the fix is a lane of its own. The after-roll deletes a ready branch
once landed is there. No lane takes the gate lock: scripts/gate_lock.sh is kept for a hand promote, where it
stops two promotes at once. gate/* is refused red since 1.0.5.99. A hand promote of a cop run fetches the
filled commit from the run's bundle first; the steps are in CLAUDE.md, Shipping.
Before the push, run the preflight (ADR-098, the addendum of 1.0.4.119):
GATE_LANE=<lane> bash scripts/preflight.sh
It first checks the ship's shape: one commit on origin/main with the changelog's top line still the version
placeholder, for the cop to fill (ADR-137). Then it runs the four gate checks a
shipping machine can run in under three minutes
and inside 8 GB (dotnet format api/TheYard.slnx --verify-no-changes, npm run format:check, npm run lint, npx tsc -b), names the red one with the first
twenty lines of its output, and then says whether this version changes
.github/workflows and whether PROMOTE_TOKEN will carry it, reading the
repository's secret NAMES and never a value. It does not run the browser suite
or the two passes on Cosmos DB: those need the gate's 16 GB runner, which is why
the gate is there. A check this machine cannot run says UNKNOWN. A red
preflight is never pushed.
A version that moves the first three numbers (ADR-130) is the owner's. It
moves the third number by one and starts the fourth at 0, its record carries
the owner's yes, and it ships by hand only: the gate's promote job ends green
with a notice and moves nothing, and the person promoting names it,
OWNER_YES=<version> bash scripts/promote.sh "$raw" <gate seconds> <version> <run>, with raw downloaded as above.
CodeRabbit is asked to read every ship (ADR-129, CodeRabbit, one rung at a time); a ship it does not get to is logged as not reviewed. Right
after the push of the gate branch, the machine that ships runs
bash scripts/gate_pr.sh open <branch>: a pull request from the gate branch into
main, titled with the commit's subject, and the comment that asks CodeRabbit for
its review, which a repository under ten stars needs. The gate's coderabbit job
waits beside the checks, up to 30 minutes, for CodeRabbit's check on the commit to
complete, and promote waits for that job. At Level 0 only a Critical finding on a
review that was read holds a ship: scripts/promote.sh reads the run's row before
it writes anything and refuses, naming the pull request and where each Critical
sits. A Major or a Minor holds nothing, and a review that never came ships with its
notice. The
review's row joins data/coderabbit-findings.json with the results, and the
after-roll closes the request on main's commit; started by hand, it closes the
request of every gate branch that names the version. bash scripts/gate_pr.sh close <branch> <main sha> does the same by hand (a bare version still names an older gate/<version> branch).
What a red gate run prints. Each log belongs to one check, and its tail
reaches the run's error annotations only when that check is red, so the failure
email names the real failure and not the green checks beside it.
What promote refuses (ADR-098, the addendum of 1.0.4.107). Before it
writes anything, scripts/promote.sh reads the named run and refuses unless
that run tested HEAD, its gate, Shed and five check jobs are all green, its coderabbit job
(where the run has one) is green, HEAD is exactly
one commit on main, and the version goes up by one in its fourth number. The
gate's two cuts read the whole branch from where it left main. Deploy and
Deploy Render refuse a commit that is no longer main's head, and the
Function's deploy one that is not on main, so re-running an older run never
rolls anything back. The Function's deploy is done only when its health route
answers 200 naming the commit it was published from.
Before the push, whoever ships does what the laptop's ship script did before
it pushed, because the gate checks these and does not write them: draws the
pictures (node docs/images/render.mjs, node docs/images/dataflow.mjs --png,
node docs/images/rings.mjs --png, node docs/images/og.mjs), strips their
stamps (python3 scripts/strip_c2pa.py docs/images), runs Prettier's write,
commits with the changelog's new line on top, and pushes the commit to ready/<lane>-<sha8>; the cop fills it at
landing. From 1.0.4.105 the gate draws the version card itself, so
the commit and the push are all a ship needs.
Nothing else waits on a machine either (ADR-098, the addendum of
1.0.4.105). Each of these is a workflow of its own and goes red on its own run:
.github/workflows/deploy-function.yml deploys the job hunt's Function when a
version touches it, started by the after-roll and never setting an
app setting; .github/workflows/blog-post.yml saves a blog post's body from
data/blog/<slug>.md, started by hand; .github/workflows/azure-read.yml
reads Azure Monitor by hand and leaves the raw answers as its artifact; and .github/workflows/foreman-eval.yml
measures the Foreman's model on a push to eval/** or by hand, before the push that depends on it and never
inside the gate (ADR: The Foreman gets a model).

Continuous deployment. When the gate promotes a version to main, it calls a
workflow named Deploy, which builds the container image, pushes it to GitHub's own registry, ghcr.io,
and to Azure Container Registry beside it (from 1.0.4.88 the roll pulls from
GitHub's, public and with no credential, and the Azure registry keeps the same
tag for the undo), and rolls it onto the one web app that serves both sites and The Shed, with no
human in the loop; it reads the Cosmos DB site's name and The Shed's name at the
origin before any domain, and the edge moves after it, only when the edge's
rules changed (ADR: One web app for every .NET process). Until 19 October a
second workflow, Deploy Cosmos, rolled the same image onto the second site's
web app, and a third, Deploy The Shed, rolled The Shed. Deploy Render
fires on the same push: it builds the rendering service's own image from
render/Dockerfile as the same version, pushes it as theyard-render, rolls
the service's web app, and is done when the service answers its readiness as
that version. The service draws a page only for an API running its own
build, so the two rolls need not land together: until the API and the
service agree, the pages are drawn in the browser, as they were
before the service existed (ADR: A rendering service beside the API). Both
web apps share one App Service plan (ADR: One plan, two sites). Each workflow signs in to Azure with a token GitHub mints for this one
repository's gate environment, so no Azure password or key is stored anywhere. The
version in the page footer is stamped by that build. The full record is
ADR: The deploy pipeline, below this entry in the menu.
Both web apps ship the same way: a Docker image built from this repository's own Dockerfile, pushed to the registry, set on the web app by its tag, and verified before anything else moves. Nothing is zip-deployed and nothing is built on the server:

A preview. Open the deployment diagram in a new page to zoom in.

One run, step by step: compute the version, sign in to Azure with the
minted token, build and push the image, roll the site, verify the origin
and the domain. Every version on the site has a page like this. The picture
is from the weeks the step was called "Roll the container group"; since
1.0.0.156 it rolls a web app and is called "Roll the site".

Deploy Render's roll and its check, read here from the workflow in this
build. The roll is one call, because every setting the service runs with is
in infra/render.bicep and only the image changes; the check waits until the
service answers its readiness as the version it was built as, and says so
when a site's API has not caught up yet:
- name: Roll the renderer
run: |
# Resource Manager sometimes answers a write with a gateway error (BadGatewayConnection on
# 1.0.3.182's roll of the SQL site); each write is tried three times, a minute apart, before
# the roll is red, and the same write twice is the same setting (ADR: The deploy pipeline).
arm() { for try in 1 2 3; do "$@" && return 0; echo "::warning::Resource Manager refused $1 $2 $3 $4, try $try of 3"; [ "$try" = 3 ] || sleep 60; done; return 1; }
# From GitHub's registry with no credential, as the API's roll (ADR-009).
arm az webapp config set -g "$RG" -n "$APP" --linux-fx-version "DOCKER|$GHCR_IMAGE" --generic-configurations '{"acrUseManagedIdentityCreds": false}' -o none
az webapp show -g "$RG" -n "$APP" --query "{state:state, image:siteConfig.linuxFxVersion}" -o json
Live from .github/workflows/deploy-render.yml, region render-roll, read from this build at 99df7a8.
- name: Verify
run: |
budget=1500
started=$SECONDS
body=""
until [[ "$body" == *"\"version\":\"$APP_VERSION\""* ]]; do
if (( SECONDS - started >= budget )); then
echo "the renderer never reported $APP_VERSION in ${budget}s (last answer: $body)"
exit 1
fi
sleep 5
body=$(curl -sS -A "TheYard-SelfRead/1 (deploy)" --max-time 30 "$ORIGIN/readyz" || true)
done
echo "the renderer answers as $APP_VERSION after $((SECONDS - started))s: $body"
if [[ "$body" == *'"same_build":false'* ]]; then
echo "::notice::a site's API does not run $APP_VERSION yet; its pages draw in the browser until it does"
fi
Live from .github/workflows/deploy-render.yml, region render-verify, read from this build at 99df7a8.
The edge deploys itself. The HTTPS front door of this site (see the
Hosting menu) is three files in this repository. Netlify builds the edge
branch, which edge-branch.yml moves to main only after Deploy has verified
the origin the rules name and only when those files changed, with no human in
the loop.
The rule that keeps an app push from redeploying three unchanged files is in
the edge's own configuration:
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- edge/ netlify.toml"
Live from netlify.toml, region ignore-rule, read from this build at 99df7a8.