Skip to content

Tools

Small command-line tools shared across SVRBC projects live in this repository’s tools/ directory. Each is a single file with no dependencies beyond a standard interpreter, and documents itself in --help.

Clone the repository and link each tool onto your PATH, so a git pull updates them:

Terminal window
git clone https://gitlab.com/svrbc/developers.svrbc.org.git ~/projects/developers.svrbc.org
mkdir -p ~/.local/bin
ln -sf ~/projects/developers.svrbc.org/tools/porkbun ~/.local/bin/porkbun
ln -sf ~/projects/developers.svrbc.org/tools/svrbc-audit ~/.local/bin/svrbc-audit
ln -sf ~/projects/developers.svrbc.org/tools/svrbc-audit-issue ~/.local/bin/svrbc-audit-issue
ln -sf ~/projects/developers.svrbc.org/tools/bazel-cache-sync ~/.local/bin/bazel-cache-sync
ln -sf ~/projects/developers.svrbc.org/tools/svrbc-mr ~/.local/bin/svrbc-mr
ln -sf ~/projects/developers.svrbc.org/tools/svrbc-review-bot-enroll ~/.local/bin/svrbc-review-bot-enroll
ln -sf ~/projects/developers.svrbc.org/tools/site-compare ~/.local/bin/site-compare
ln -sf ~/projects/developers.svrbc.org/tools/svrbc-new-site ~/.local/bin/svrbc-new-site
ln -sf ~/projects/developers.svrbc.org/tools/svrbc-accounts ~/.local/bin/svrbc-accounts
ln -sf ~/projects/developers.svrbc.org/tools/svrbc-blast ~/.local/bin/svrbc-blast

Tools never contain credentials. They read them from the environment or from ~/.env.

A CLI for the Porkbun v3 API: domains, DNS records and nameserver delegation. It’s written rather than installed because what a wrapper is handed is registrar credentials, and a short, dependency-free script is easier to trust than somebody else’s package.

Terminal window
porkbun ping # which account am I acting as?
porkbun domains --all # every configured account
porkbun check <domain> # why won’t it resolve?
porkbun dns list <domain> [--type T] [--name N]
porkbun dns set <domain> <type> <name> <content> [--ttl 600] # an upsert
porkbun dns delete <domain> --id <id>
porkbun ns get|set <domain> [<host> …] # registry delegation
porkbun email list <domain> # email forwards
porkbun email add|delete <domain> <name> <to> # info@<domain> → a mailbox
porkbun funding # credit, saved card, auto top-up

Credentials. The default account’s keys are PORKBUN_API_KEY and PORKBUN_SECRET_KEY. Each further account is a profile: PORKBUN_<NAME>_API_KEY and PORKBUN_<NAME>_SECRET_KEY, selected with --profile <name>. SVRBC’s domains are all in the svrbc profile (see Domains).

Wrong account. When a command fails because the domain is in another configured account, porkbun names that account. It never switches by itself; rerun with the --profile it suggests.

Beyond the CLI. Porkbun’s API covers far more than these commands (DNSSEC, URL forwarding, SSL, glue records), and every write accepts dryRun. The whole reference is greppable at https://porkbun.com/llms-full.txt. Email forwarding has an API (porkbun email); the first forward adds Porkbun's MX and SPF records at the apex, which a domain's DNS stack should list as not its own.

svrbc-fork is an older name for it, and still works, as a link to this one (svrbc-fork mr is svrbc-mr).

How a change reaches an SVRBC project: push a branch to the project’s fork in svrbc/forks and open a merge request (Source code), and, to release it too, ship it (Releases). Run it on a branch in a clone of the project:

Terminal window
svrbc-mr # send: push this branch to the fork, open (or show) its merge request
svrbc-mr --ship [minor|major] # ship: bump the version (patch by default), open it, set auto-merge, watch it deploy
svrbc-mr --ship --no-watch # ship, but stop once auto-merge is set
svrbc-mr --watch [IID] # watch this branch’s merge request (or !IID) through merge, tag and deploy
svrbc-mr --title T
svrbc-mr --no-build # push without building, testing and uploading first
svrbc-mr --no-rebase-check # push even when the branch is behind `master`

It creates the fork the first time anyone needs it (and the remote fork), refuses to push master, and refuses a branch that isn’t rebased onto the project’s current master (merges are fast-forward), checking that before it builds anything. With --no-rebase-check it pushes the branch anyway, and the review bot rebases it once someone sets auto-merge. It never pushes the fork’s master: the review bot keeps that current. Credentials: GITLAB_TOKEN, or glab’s login.

--ship takes the version on master (package.json’s, or VERSION’s), bumps it into the branch’s last commit, whose subject gains “; release ” (a branch with no commits of its own gets a commit of just the bump), and builds after that, so the release is what’s verified. A branch that already raised the version keeps it, so shipping again changes nothing. It refuses a project whose CI doesn’t include ci/release.yml, where a merge deploys nothing. Watching exits 0 once the tag’s pipeline passes and the site’s /_/version.json names the release (the pipeline alone, for a project with no production environment or a site that doesn’t serve the file yet; or once merged, for a merge request that didn’t change the version), 1 when something failed, 3 when it’s waiting for a person (an owner’s approval, or a Maintainer to merge), and 4 after --timeout minutes (60).

In a Bazel project, it builds and tests the commit first (bazel test //...), and uploads the results with bazel-cache-sync and your GitLab token, as any developer’s workstation may, so the merge request’s pipeline finds every step already done. It builds in an output base of its own (~/.cache/svrbc-mr/<project>/<tree>-<hash>/, one for each working tree) with an empty disk cache, so it uploads only what this commit needed, never your everyday disk cache. Its bazel-* links then point there, and Bazel skips only the links of the output base it is using, so every Bazel project's REPO.bazel ignores them all (ignore_directories(["bazel-*"]), as the template's does), or a plain bazel test //... in the same checkout fails in them. Last, it records the commit as verified, so the review bot runs no pipeline for it. It pushes nothing if the working tree has changes, if the build or tests fail, or if the upload fails. svrbc-mr --no-build skips all of that, for a change too heavy to build locally. In a project with infra/ it then plans the infrastructure the branch changes, when this machine is signed in to the svrbc AWS profile (Changing infrastructure); otherwise, or when that sign-in has expired (it says so), the fork’s pipeline plans it.

The review bot. Where people merge (review mode), it posts the commit statuses review-bot/approved (the owners in the target branch’s .gitlab/CODEOWNERS have approved) and review-bot/verified (a verified commit with no pipeline of its own), which GitLab’s Pipelines must succeed requires; starts the pipeline itself when a commit isn’t verified; starts a fork pipeline’s review-bot job (ci/review-bot.yml) once its statuses are in that pipeline; and keeps the auto-merge queue moving: it rebases the first approved merge request someone set auto-merge on and sets auto-merge on it again. It never merges itself. After a merge into master it releases, when the version has no tag yet: it creates the tag and starts its pipeline, with SVRBC_PREVIOUS_RELEASE (Releases). And it fast-forwards the fork’s master, before it looks at any merge request; a sweep finishes either if a run didn’t. It runs as a Lambda function, svrbc-review-bot: a container image of tools/review-bot/ (worker.py is its entry point), invoked by the webhook receiver tools/review-bot/hook/ within seconds of each event, and by two schedules as a backstop for a webhook that went astray, all described in infra/review-bot/. The projects it looks after are tools/review-bot/projects.txt, one a line: the name, then the branches in review mode (review for master, <branch>=review for another), and after=<project> for a project that should release after another’s releases: after each of that project’s v* tags, once its pipeline has passed and ten minutes more have gone by (a CDN may still serve the release before it for its cache time, and the follower’s first build would read that), the bot commits a patch bump of the follower’s version to a branch of its fork and opens a release merge request with auto-merge set, titled “Data: v… ; release …”, which its owners approve like any. Once per upstream release: a merge request from that branch, even a closed one, means it is done. Only the newest release needs one, since a release fetches the upstream as it is: one still open for an older release is closed as superseded, and one whose version another release took meanwhile is bumped again from master rather than held. symbolics-sites follows symbolics.dev (svrbc/symbolics-sites#33): the bot's token has Commit: Create and Merge request: Create for it. The design and its history are in svrbc/review-bot’s PLAN.md.

Terminal window
tools/review-bot/review_bot.py check <project> <iid> # what it would decide, and why; reads only
tools/review-bot/review_bot.py owners <project> <path>… # who owns these paths
tools/review-bot/review_bot.py run --dry-run <project>… # comment and label, never push
tools/review-bot/review_bot.py run --review master <project> # treat master as in review mode
bazel test //tools/review-bot/... # the tests, and the image built and checked

Credentials, run by hand: REVIEW_BOT_TOKEN or GITLAB_TOKEN, or glab’s login; merging and releasing also need REVIEW_BOT_DEPLOY_KEY. REVIEW_BOT_USER names whose statuses count as the bot’s (default svrbc_bot), for trying it with your own login. In Lambda, all of it comes from SSM (/svrbc/review-bot/token, /deploy-key, /token-expires, and /webhook-secret for the webhooks it sets up).

It enrols the projects it looks after. A project’s line in projects.txt is all it takes: on each sweep the bot sets up any line it hasn’t set up yet (review_bot.py’s enrol: fork, deploy key, merge settings, webhooks, release tags, the fork’s master, and last the protection), and records the lines it finished in SSM (/svrbc/review-bot/enrolled), so a new line is set up within 15 minutes of the release that applies it, and a project it can’t finish yet (no CODEOWNERS on master, say) is tried again each sweep. Once a day (12:00 UTC, {"ENROLL": true}) it goes over every line, putting back whatever was changed by hand. Its problems only go to its log, so as not to fail the run; svrbc-review-bot-enroll and the audit show them. Everything it changes takes Maintainer, which svrbc_bot is in svrbc and svrbc/forks (GitLab’s protected branches and tags, webhooks, deploy keys, members up to Maintainer and the merge settings all take Maintainer, and svrbc/forks lets Developers create projects), so nothing is left for an Owner.

Its sweeps look only at what changed. The bot runs one run at a time (reserved concurrency 1: two runs never race, and none still holds the old token when another rotates it), so a webhook’s run waits for whatever run is ahead of it, and a sweep has to be quick. Every 15 minutes it sweeps what changed in the last hour (SWEEP_WINDOW, four sweeps wide, so one that failed misses nothing): it lists the group’s open merge requests, and those merged in that hour, in two requests, and looks at a merge request that changed, or whose latest pipeline did (one request each: a pipeline finishing doesn’t touch its merge request), and at the whole of a project that merged something, releasing first. Looking at everything takes minutes at GitLab’s rate limit, and a release merged meanwhile waits for it to be tagged, so only once a day (11:00 UTC) does a full sweep look at everything. review_bot.py run --changed-within 60 … sweeps as the schedule does.

It keeps to GitLab's rate limit. GitLab.com allows a free-plan user 100 requests a minute (burst_traffic_per_user_free_plan), and the full sweep needs several times that. So the bot paces itself: when a response says only a few requests are left in the window (RateLimit-Remaining), it waits for the reset (RateLimit-Reset), and it waits out a 429 too, within 10 minutes of waiting a run; the function's timeout is 14 minutes, so a sweep finishes before the next.

Its token renews itself. The token is a fine-grained token of svrbc_bot, and /svrbc/review-bot/token-expires records when it expires. At the end of a run, when fewer than 330 days are left (so about monthly), the bot rotates the token for another year and writes both parameters. So it never nears expiry, and a broken rotation leaves about eleven months to notice. If one rotates but can’t store the new token, the old one is already revoked: the run fails saying so (in the function’s log), and someone makes a new token by hand. To rotate it now, whatever the date, invoke the function with {"ROTATE": true} (review_bot.py rotate prints the command); only the function can store the new token.

Its token needs Project: Read for a private project. A fine-grained token reads public projects without it, so nothing shows the gap until a private project such as svrbc/plans.svrbc.org: without it, every read of the project and its fork gets 403 (insufficient_granular_scope), and the bot takes the merge request for one from outside svrbc/forks. The token has it, and Commit: Create and Merge request: Create for after=, and Job: Read and Run, to start a fork pipeline’s review-bot job (without Run, GitLab refuses it: 403 insufficient_granular_scope). It has neither User: Read nor Personal Access Token: Read, so it can't say whose it is or when it expires (/token-expires does). Enrolling needs more: in the names of GitLab’s table of fine-grained permissions, Project: Update and Fork, Webhook: Create, Read, Update, Delete, Deploy Key: Read, Enable, Update, Delete, Protected Branch: Read, Update, Branch: Protect, Protected Tag: Read, Tag: Protect, Member: Read, Create and Label: Read, Delete. Not yet tried on a token: the names are from GitLab’s documentation, and the bot’s log says which one a refusal wants (enrolling stops at the first 403 and goes on once the token has it). GitLab can’t add a permission to an existing token: to make one by hand, sign in as svrbc_bot, use Duplicate on the old token in Access tokens (it copies the group and permissions), and store the new one in /svrbc/review-bot/token and /token-expires.

Checks that projects are under the review bot; it changes nothing. Enrolling a project is a merge request adding its line to tools/review-bot/projects.txt: the review bot then sets the project up itself (How it’s enforced). This runs the bot’s own checks (review_bot.py’s enrol) and says what is still missing of the project’s fork, the bot’s deploy key (with write access), the merge settings (Pipelines must succeed, skipped pipelines not successful, automatic rebase off, fast-forward, no squash), the two webhooks (merge request and push events from the project, pipeline events from its fork), the tests:: labels (gone), the protected v* tags (in a project that includes ci/release.yml, with svrbc_bot a direct member there), the bot’s key on the fork’s master, and the protection (merge Maintainers, push No one, and the * rule pushing and merging No one, made if there is none); and of what people write by merge request, CODEOWNERS and the line in projects.txt. The bot leaves its own access alone, so its key left on a master’s push list is for a person to take off (the audit reports it).

Terminal window
svrbc-review-bot-enroll --all # where every project stands
svrbc-review-bot-enroll <project>… # where these stand

It needs only a GitLab token that can read the projects’ settings (Maintainer), and no AWS login. It compares webhooks with the receiver’s URL as committed in infra/review-bot/hook-url.txt (a plan there warns if that file is out of date); a webhook’s secret can’t be read back, and only the bot, which holds it, sets it.

Starts a new site: a static Astro site (Stack, tier 1) on S3 and CloudFront, with everything every SVRBC site has already in place, so that only what is the site’s own is left to write. It writes from this repository’s templates/.

Terminal window
svrbc-new-site site hymns.svrbc.org --name "SVRBC Hymns" --description "The hymns SVRBC sings" \
--color '#1d4e89' --dir ~/projects/hymns.svrbc.org # a fresh clone of the project, or empty
svrbc-new-site infra hymns.svrbc.org --commit --site ~/projects/hymns.svrbc.org
# then svrbc-mr --ship here; four times
  • site writes the site’s repository from templates/astro-site: the Bazel build (the site, its icons, //:site_test, //:budget_test with the default budget, //:lint_test (Checks) and the vitest suite), CI with releases and verified commits, a PWA, the special pages, the CloudFront router, the deploy (//:deploy_aws), AGENTS.md and a README, with the domain, names, tagline (--tagline, for the home page’s title; the description by default) and color put in, the color with the palette it derives from it, and svrbc_bazel pinned to this repository’s newest bazel/.
  • infra writes the site’s AWS resources and DNS records here, in infra/<domain>-site and the zone’s DNS stack. They come up in four merge requests, each shipped before the next can be written, since each needs what the one before made: the certificate; its validation CNAMEs; the bucket, distribution and deploy role (CloudFront won’t take an alias whose certificate isn’t issued); and the site’s DNS records: a CNAME, or an ALIAS at the zone’s apex, which can’t hold a CNAME. Each run works out which comes next, from the files and from AWS, and writes it; it exits 3 while the step before is still to be applied or ACM is still validating. --commit puts it on a branch from origin/master, committed, for svrbc-mr --ship; --site puts the distribution’s id in the site’s .gitlab-ci.yml; --check only says which step is next.

A site at a domain’s apex answers for www too: the certificate names both, so step 2 writes two validation CNAMEs; the distribution has both as aliases; step 4 makes an ALIAS at the apex and a CNAME at www; and the template’s router redirects www to the apex (on a subdomain’s site, no www name reaches it). --no-www at step 1 leaves www out; after that, the names are the ones the certificate has, so a site made without www (symbolics.dev) keeps to its apex. A new domain’s stack is made without Porkbun’s parking records (pixie.porkbun.com).

A site moving here (Moving a site) already has records at its names, imported into the DNS stack. Step 4 changes each in place to point at the distribution, which Porkbun does as one edit, rather than adding a second record beside it, which Porkbun would refuse; it says which records it changed, so check that each was the old site’s. Step 2 warns about a name that is a CNAME to another host, whose CAA records may keep ACM from issuing.

It doesn’t make the GitLab project (do that as New projects says) or a zone’s DNS stack. It reads AWS with AWS_PROFILE (default svrbc), and changes nothing there: the releases apply what it writes.

The template is built and tested here: templates/astro-site is a package of this repository’s workspace, so bazel test //... (and so every svrbc-mr) builds it and runs its tests, and //:new_site_test writes a site from it and walks the four infra steps against a stand-in. A change to what every site has goes in the template too, so the next site starts with it.

A public service’s own accounts are a second template, templates/public-accounts (Stack): a Rust API and two pages, copied into a site this tool made and renamed by hand, as its README says. The tool doesn’t write it, since few sites need it. bazel test //... runs its API’s tests (rules_rust, Building the function) and builds its pages on top of templates/astro-site.

SVRBC accounts from a terminal, with an administrator’s AWS credentials: what auth.svrbc.org/admin/ does, plus what it can’t, the first admin and the signing keys.

Terminal window
svrbc-accounts grant admin someone@example.com # the first admin, before anyone has signed in
svrbc-accounts grant member a@example.com b@example.com
svrbc-accounts revoke member a@example.com
svrbc-accounts list # accounts, their groups, and waiting grants
svrbc-accounts check # does the KeyValueStore match the table?
svrbc-accounts rotate-key # a new signing key (the first run makes the first)
  • A grant to an address with no account waits for it, and moves to the account at its first sign-in. One to an account is written to the table, then to the KeyValueStore every site reads, so it takes effect at once.
  • The group must be in auth.svrbc.org’s groups.toml (read from GitLab, or --groups for a checkout), and the last admin can’t be revoked.
  • check compares every account’s KeyValueStore entry with the table, and the store’s signing keys with SSM’s, by hash. It prints no key and exits 1 on a difference; svrbc-audit doesn’t run it, since the planner can’t read either (Who can read what).
  • rotate-key writes a new key to the store first and then to SSM, where the function picks it up at its next cold start; old keys stay valid until --drop. A key travels from the tool to AWS in an in-memory file, never on a command line or in a file on disk.

It runs the AWS CLI, whose bundled CRT signs the KeyValueStore’s SigV4A requests.

Proves a new build of a site equal to the old one before it replaces it (Builds and CI). It opens each route on both in headless Chrome, at each width and in each color scheme, and compares full-page screenshots and the page’s text:

Terminal window
site-compare 'https://{host}.doreancon.org' 'http://{host}.localhost:4322' \
www/ www/hymns 2025/ travel/
site-compare https://developers.svrbc.org http://localhost:4321 / /builds --widths 1280

{host} in the two URL templates stands for each route’s host (<host>/<path>). For each page it prints whether the screenshots match, the share of rows that differ and where the first is, and how the text changed; into --out (default ./site-compare) it writes both screenshots and, for a page that differs, the two side by side from just above the first difference. Exit status is 1 when anything differs beyond --threshold (0.5% of rows). It needs Chrome or Chromium, nothing else: the pixels are compared in the browser.

Shows what an edit to a file reruns: the Bazel steps and tests that list it (Builds and CI). Bazel fails a step missing an input, but never one given inputs it doesn’t read; those only rerun it. Run it in a repository’s checkout after adding or changing a target:

Terminal window
svrbc-blast content/sermons/2026-11-16.md src/lib/date.ts
svrbc-blast --sample # one file of each kind under each top-level directory
svrbc-blast --json …

Each list should be one you would expect: a Markdown page reruns //:site and the tests of the built site, not the unit tests; a stylesheet doesn’t rerun a PDF render that never reads it. It asks bazel query 'rdeps(//..., <file>)', which reads BUILD files only, so it builds nothing.

Uploads a machine’s Bazel disk cache to the shared cache. Bazel only ever reads https://bazel-cache.svrbc.org; a developer’s machine, or CI, builds into ~/.cache/bazel-disk as usual and then runs this.

Terminal window
bazel-cache-sync --dry-run # what would go up
bazel-cache-sync
bazel-cache-sync --disk-cache DIR
bazel-cache-sync --marker FILE # then FILE, last, as ac/<its name>

It flattens the disk cache’s ac/d6/d6fa… layout to the ac/d6fa… that Bazel’s HTTP protocol reads, and uploads every cas/ blob before any ac/ entry, so a result never appears before its outputs. Entries already in the bucket are skipped.

Credentials come two ways (--via):

  • gitlab, on a developer’s workstation: your GitLab token (GITLAB_TOKEN, from the environment, then ~/.env, else glab’s) goes to svrbc-bazel-cache-upload, which checks that you are a Developer or more in the svrbc group and answers with a presigned upload URL for each entry the bucket lacks. No AWS account or CLI.
  • aws, in CI: the short-lived keys the template gets through GitLab OIDC, through the aws CLI (the base image has it). It needs only s3:ListBucket and s3:PutObject. An administrator can use it by hand too, with AWS_PROFILE=svrbc.

It picks aws when AWS_ROLE_ARN, AWS_ACCESS_KEY_ID or AWS_PROFILE is set, and gitlab otherwise. svrbc-mr always uses gitlab.

Checks every project in the svrbc GitLab group, and the site each one serves, against the rules in this handbook. Rules written down drift from what is actually configured; this finds where.

Terminal window
svrbc-audit # every project; only problems are shown
svrbc-audit --all # passing checks too
svrbc-audit -p psalter.svrbc.org # one project (repeatable)
svrbc-audit --no-sites # skip the Porkbun and HTTP checks
svrbc-audit --json
svrbc-audit --list-checks
svrbc-audit --press-states ~/projects/svrbc.org # one check, on a checkout
Check Rule
group-default-branch New projects default to master (Source code)
group-2fa Members must use two-factor authentication. A warning while it’s an open question
no-stray-forks Every fork in svrbc/forks belongs to a project that exists and isn’t archived or marked for deletion (Source code)
bot-projects-live Every project in tools/review-bot/projects.txt exists and isn’t archived or marked for deletion (Source code)
default-branch The default branch is master
branch-protection Nobody pushes to master or force-pushes, counting every rule that matches master (the most permissive wins), and Maintainers merge it once the review bot’s statuses pass; a * rule letting Maintainers merge, or the bot’s key on master’s push list, fails it. A warning for a project the bot doesn’t look after yet (Source code)
gitlab-avatar The project has a GitLab avatar, and no other project has the same one (a warning; Source code)
t3-icon A t3.json at the root names the project’s logo as its iconPath: a committed image that doesn’t draw another file (a warning, or a failure when the image isn’t there; Source code)
codeowners .gitlab/CODEOWNERS exists, and its * rule names known users (Source code)
review-bot The review bot looks after the project: its deploy key, both webhooks, its line in tools/review-bot/projects.txt, the protection, and its key on the protected v* tags (in a project that takes releases, with svrbc_bot a direct member, which GitLab requires of a key’s owner to create tags) and on the fork’s master. A warning listing what’s missing (the bot sets it up once the project is in projects.txt; svrbc-review-bot-enroll shows how far it has got)
merge-checks Where people merge (review mode): Pipelines must succeed on, skipped pipelines not successful, automatic rebase off, fast-forward (The review bot)
fork-protection The project’s fork, if it has one, takes branches but not pushes to its master (Source code)
fork-merged-branches The fork keeps no branch already merged into its master (a warning; Source code)
fork-features The fork has no issues, wiki, snippets or other features of its own: only its repository, merge requests, CI and container registry (a warning; Source code)
tag-protection Existing tags are covered by a protected-tag rule creatable by maintainers at most
release-gate A project that deploys from CI does it from release tags: it includes ci/release.yml, so only a merged version bump (tagged by svrbc_bot) deploys. A warning for one that deploys on every merge to master instead, such as GitLab Pages from master (Releases)
review-gate Each pipeline in the fork waits at the review bot’s review-bot job until the bot’s statuses are in it: CI includes ci/review-bot.yml (or ci/bazel.yml, which includes it). Without it, a pipeline started by hand can pass, and auto-merge merge, before they are (a warning; The review bot)
fork-pipelines A push to the project’s fork starts no pipeline (except for paths bazel test //... doesn’t cover), so the review bot can take a verified commit as tested (a warning; Builds)
master-pipelines In a project that releases from tags (includes ci/release.yml), a push to master starts no pipeline: the merged commit already passed, and the review bot starts each release’s pipeline (a warning; Builds)
ff-only The project and its fork merge fast-forward only, with squashing off (Source code)
merge-settings Source branches deleted, a passing pipeline required, and ci/fork-sync.yml (retired: the review bot syncs the fork) no longer included (a warning)
bazel-lazy-tools A Bazel build gets its tools from svrbc_bazel’s nix_tools, not rules_nixpkgs (Builds and CI)
bazel-shared-cache .bazelrc reads the shared cache and never uploads through Bazel (Builds and CI)
bazel-ci-downloads CI’s bazel build //... passes --remote_download_minimal (a warning; Builds and CI)
bazel-tests Tests are Bazel tests: CI calls no test runner (npm test, cargo test, …) itself, and a package.json with tests has a Bazel test that runs them (a warning; Builds and CI)
tests-exist A project with code has a test bazel test //... runs: a *_test(…) or test_suite(…) in a BUILD file, not tagged manual, or a macro of its own that calls one. One with code but no Bazel build (no MODULE.bazel, or no BUILD file) fails. Code is a source file in a programming language (not shell) outside build steps, configuration, tests, infra/, nix/ and generated or vendored paths; a repository with none gets no result (Builds and CI)
test-coverage The newest release’s pipeline reports at least 80% line coverage, which GitLab records from ci/bazel.yml’s .svrbc-coverage job; none is a failure too, in a project not built with Bazel as in one that is. A project with no release yet is read from its newest passing pipeline, then its fork’s (Builds and CI)
bazel-rust A Rust crate (api/Cargo.toml or Cargo.toml) is built with rules_rust and svrbc_rust’s toolchains: they are registered, crate.from_cargo has svrbc_rust’s host_tools and a committed lockfile, and .bazelrc turns off rules_rust’s sysroot. Cargo inside one step is a warning; rules_rust with its own toolchains, which download rustc even when every step is cached, fails, as does a setup missing one of those pieces (Stack)
bazel-npm-step A Bazel repository with package-lock.json installs it as a Bazel step (Builds and CI)
bazel-site-build A Nuxt site in a Bazel repository is built by Bazel, from copied inputs (Builds and CI)
bazel-deterministic-tars Tarballs made in build steps are sorted, with zero timestamps
bazel-ignore-links REPO.bazel has ignore_directories(["bazel-*"]), so bazel test //... doesn't wander into the output links of another output base, as svrbc-mr's (a warning; svrbc-mr)
bazel-glob-ignored Globs exclude Git-ignored (generated) paths (Builds and CI)
bazel-narrow-inputs A test lists only what it reads: no test given content/ or public/ (a unit test reads the code), and no glob(["**"]) of a whole package, outside the template’s template-only block. It reads BUILD files only, so a test that does read content is flagged too (a warning; Builds and CI; svrbc-blast shows what an edit reruns)
site-budget A site built by Bazel (a //:site target in the root BUILD.bazel) has a //:budget_test holding its pages to a load-time budget (a warning; Sites)
bazel-script-symlinks Scripts Bazel runs find the repository without following symlinks
hosting-default The site is deployed to AWS (or, for developers, GitLab Pages), not Vercel or Netlify (Hosting)
lambda-traps For a Lambda site: Nuxt Content’s database in /tmp, no aws s3 sync of a zero-timestamp build, Nitro’s package links followed when zipping (Hosting)
ci-pinned-tools Nothing in CI is fetched @latest
group-runners At least two of the svrbc group’s own runners are online (a warning; Builds)
own-runners No CI job is pinned to GitLab’s hosted runners (saas-linux-… tags), whose minutes run out (a warning; Builds)
shell-nix-nocc shell.nix uses mkShellNoCC
bazel-one-nixpkgs shell.nix pins the same nixpkgs as MODULE.bazel (a warning)
no-other-branches Nobody can push another branch, apart from exceptions AGENTS.md explains (Source code)
tofu-central Only developers.svrbc.org has OpenTofu stacks, in infra/ (a warning; AWS)
tofu-lockfile Each OpenTofu stack commits its .terraform.lock.hcl (AWS)
tofu-no-state No OpenTofu state, saved plan or .terraform/ is committed (AWS)
tofu-remote-state Each stack keeps its state in S3, locked with use_lockfile (a warning)
tofu-pinned A shell.nix pins OpenTofu (a warning)
agents-md AGENTS.md exists and names this handbook (Agents files)
claude-md CLAUDE.md is a one-line pointer to AGENTS.md (a warning)
analytics A site with analytics uses PostHog (posthog-js, or cookieless pageviews of its own), without session replay, and sends to SVRBC’s shared project, which analytics.svrbc.org shows, rather than embedding a dashboard of its own (a warning; Sites)
analytics-recorded Every site is on analytics.svrbc.org: its host is in the page’s data.json, so it sent the shared PostHog project an event lately (Sites)
pages-domain A GitLab Pages domain is verified and has a valid certificate
project-name A project that publishes a site on GitLab Pages is named after its domain (a warning; New projects)
porkbun-account The domain is in the svrbc Porkbun subaccount (Domains)
porkbun-funding The svrbc subaccount has a saved card and auto top-up on, so its renewals are paid (Domains)
site-up The site (a Pages domain, the project’s name if it is a domain, or each host its .gitlab/hosts lists) answers over HTTPS; a members-only Pages site by sending a visitor to GitLab’s sign-in, and the checks that read its pages are skipped
page-titles The home page’s title is <site name> — <tagline>, under about 60 characters, and /_/’s is <page> · <site name> (or the manifest’s short_name, or on a multi-tenant site the name its tenants share), with no other separator (a warning; Sites)
sitemap The site serves a robots.txt, which names its sitemap with a Sitemap: line, https://<host>/sitemap-index.xml on the host that serves it, and that URL answers with a sitemap index or a <urlset> (a warning; Sites)
special-pages The site serves /_, /_/architecture and /_/og, and its home page doesn’t link them (Sites)
source-commit The site’s /_/ links the commit it was deployed from, on GitLab (a warning; Sites)
site-version The site’s /_/version.json names the commit (a full SHA) and the release (its tag) it was deployed from, filled in by the deploy (a warning; Sites)
pwa The site is a PWA: its home page links a manifest with a name, a start URL, a standalone display and 192, 512 and maskable icons, and registers a service worker (a warning; Sites)
link-previews The home page has its link preview: every Open Graph tag, an absolute og:image that loads as a 1200×630 PNG or JPEG, and twitter:card summary_large_image (a warning; Sites)
og-overview-tags A site’s src/og-overview.mjs reads each tag whole, letting a double-quoted value hold a >, as the template’s does: it fails on the pattern /<(?:meta|link)\s[^>]*>/g, which cuts a tag short there and fails the build on a page that has the tag (Sites)
urls-no-slash An Astro site’s page URLs have no trailing slash: a warning for trailingSlash: 'always' (Sites)
stack-front-end A site is built with Astro: static, or rendering on the server through @astrojs/node for a reason AGENTS.md gives. A warning for anything else, Nuxt included (Stack)
pages-audience A project publishing GitLab Pages keeps it to project members, or says in AGENTS.md that its public site is developer-facing (a warning; Hosting)
stack-api A site’s API is a Rust function on Lambda, not JavaScript (a warning; Stack)
stack-islands Islands are Solid, not Svelte, and a component doesn’t destructure its props, which then never update (a warning; Stack)
lint A JavaScript or TypeScript project (package.json depends on TypeScript, Astro, Nuxt, Vue, Solid or Svelte) has an eslint.config.js whose rules are type-aware (typescript-eslint’s *TypeChecked presets, or a parser given the project), and its root BUILD.bazel runs ESLint in a test. A warning, and one for @svrbc/eslint-config, which is archived (Checks)
press-states A button with a hover state has an active state too: a Tailwind class string with hover: has active: (or one of its classes has an :active rule in a stylesheet), and a CSS X:hover has an X:active. A button is a <button>, role="button", a submit input or a <summary>, or anything whose hover changes more than its text color or underline. It reads up to 150 markup and stylesheet files, and --press-states <checkout> lists every finding (a warning; Sites)
site-scrollbars A site’s scroll bars are custom, styled in its stylesheet, not the browser’s (a warning; Stack)
mail-ses A project that sends mail sends it through Amazon SES: a warning for another provider’s package or API in package.json or a source file named for mail or config (Stack)
accounts-domain A site whose router has access rules is svrbc.org or a subdomain of it, where the session cookie reaches (Accounts)
accounts-groups Every group a site’s router names is in auth.svrbc.org’s groups.toml, and a site’s own groups carry its hostname (a warning; Accounts)
accounts-edge Each path the router protects, and the page a rule ending in a slash names (/members for '/members/'), asked for without a session, answers a redirect to sign in, never the page (Accounts)
account-menu A project with accounts, by central sign-in (its router has access rules) or its own (api/src/webauthn.rs), has the template’s account menu at src/components/AccountMenu.astro, the same file as the handbook’s templates/astro-site’s on master (by SHA-256, line endings aside); one that isn’t fails, naming the handbook release it fell behind at (the release that changed the template after the copy’s version), or saying it was edited (it matches no version). A layout (src/layouts/, or a header or nav component) uses it (<AccountMenu), and none draws a sign-in or sign-out link of its own (“Sign in” or “Sign out” as a link’s or button’s text, /api/signout, or a link to auth.svrbc.org/?return=). One with its own sign-in also has the sign-in page’s passkey offer (data-passkey-offer) and passkeys in api/bindings/MeResponse.ts. The detail says what is wrong (Accounts)
form-protection A site whose API takes a posted form (axum’s Form extractor in api/src/) checks Cloudflare Turnstile’s token (siteverify in api/src/), and its pages carry the widget (cf-turnstile) and the hidden field (name="website") somewhere in src/ (a warning; Forms)

Which sites. Many SVRBC sites are hosted on AWS, Netlify or Vercel, not GitLab Pages, so GitLab doesn’t know about them. A project counts as serving a site if it has a Pages domain, if its name is a domain (psalter.svrbc.org), or for each host its .gitlab/hosts lists (symbolics-sites).

It only reads. Fixing a finding usually affects other people, so the tool reports and a person decides. Exit status is 1 when a check fails; warnings don’t count.

Credentials. A GitLab token from GITLAB_TOKEN (environment, then ~/.env), or else the one glab is logged in with. The domain check runs porkbun and is skipped if that isn’t installed.

Code is read from clones, settings from the API. Each project’s files come from a shallow clone of it (git fetch --depth=1, blobs over a megabyte left on the server until read), kept under ~/.cache/svrbc-audit/repos (--checkouts DIR) so the next run fetches only what changed. Reading them through the API was three quarters of a run’s requests in November 2026 (a request a file, and pages of each tree), and GitLab rations a user’s API requests but not git’s. The token reads the clones too (as oauth2, in the environment, never on a command line); a project git can’t fetch is read through the API, as before. Settings (protection, hooks, deploy keys, Pages) have no copy in the code, so they still cost a request each: about 20 a project. --api-stats counts a run’s requests by endpoint.

Adding a rule to the handbook? Add a check in the same commit: one function in tools/svrbc-audit, registered in CHECKS with the page that states the rule, and a row in the table above.

A run spends nearly all its time waiting on GitLab, Porkbun and the sites. It also runs nightly in CI, which files what it finds as an issue (svrbc-audit-issue). There it runs as svrbc_bot, whose API requests GitLab.com rations more tightly than a person’s, so it waits out each 429 (Retry-After); the job’s timeout is six hours.

The svrbc-audit skill teaches an agent to run it and work through the findings.

Keeps svrbc-audit’s findings in a GitLab issue, so a failing check reaches a person as an issue assigned to them rather than as one more failed-pipeline email.

Terminal window
svrbc-audit --json > report.json; svrbc-audit-issue report.json --status $? --dry-run

One open issue at a time. It keeps a confidential issue in developers.svrbc.org, labelled audit and assigned to its maintainer, listing every failing check by check, with the warnings folded below. An open one is rewritten each night, and gets a comment saying what is new and what was fixed only when failures come or go (the comment is what notifies; a comment every night would teach its reader to skip them). With none open, a failing audit opens a new one, so each closed issue is the record of one cleanup. When nothing fails, it closes the open issue. Warnings alone never open one. An audit that couldn’t run opens one too, or comments on the open one, so a broken run can’t pass for a clean night (once: not every night it stays broken). It is confidential because the project is public and the report names private projects.

The drift check is in it too. --drift drift.json adds tofu-drift’s result as one more check, infra-drift, for infra/: AWS differing from infra/ as the latest release has it (the stacks named), or the drift check failing to plan. It stays in tofu-ci, which plans and applies with the same code, rather than in the audit, which would then need AWS and OpenTofu wherever it runs.

The nightly job. The svrbc-audit job in .gitlab-ci.yml runs on the project’s pipeline schedule, nightly at 11:00 UTC (3 or 4 a.m. in California, when nobody is merging), after tofu-drift in the same pipeline, whose drift.json it files with its own report. Both run on every schedule on master; there is one. Its token, SVRBC_AUDIT_TOKEN, is a personal access token of svrbc_bot (scope api) made for this alone, a protected, masked and hidden CI/CD variable of this project scoped to the infra environment, beside the Porkbun keys. It is the job’s own: never the review bot’s token, which rotates itself too, and two holders of one rotating token get it revoked. It isn’t a group or project access token because GitLab.com makes those a paid feature (even an owner gets “User does not have permission to create group access token”).

Its token renews itself. --rotate SVRBC_AUDIT_TOKEN rotates the token it ran with (GitLab’s self-rotation: the old one is revoked, the new one lasts 364 days) and stores the new one in that variable, last, after the issue. Rotating revokes the old token at once, so if the new one can’t be stored the job fails loudly (exit 3) and the token must be made again. The job’s resource_group keeps two runs from overlapping, which would get both tokens revoked.

Setting it up, once, by a maintainer of developers.svrbc.org with glab logged in as them:

Terminal window
svrbc-audit-issue --setup --dry-run # what it would make
svrbc-audit-issue --setup # the schedule; and how to make the token

Only the bot can make its own tokens, so someone signed in to GitLab as svrbc_bot makes one at the link --setup prints (named and scoped already), and hands it over:

Terminal window
ask-relay secret --label "svrbc_bot's svrbc-audit token" -- svrbc-audit-issue --store-token

--store-token reads it on stdin, checks it is svrbc_bot’s, active and api-scoped (anything else exits 65, so ask-relay asks again), and saves it into the variable, so its value is never printed, stored elsewhere or passed on a command line. Its expiry doesn’t matter: the first run rotates it to a full year. The schedule’s owner is whoever runs --setup, and only someone who may merge into master can own one. If the token is ever lost (exit 3), revoke the old one in svrbc_bot’s settings and store a new one the same way.