Run the checks
Every change runs the checks that cover it before it goes to GitHub. The checks live in test/, one file per step, named test/step<id>.ts. Each step starts what it needs, such as its own API on test ports, and removes what it made when it passes. This page is for anyone who changes the repo and for anyone who adds a check. The checks run on the developer’s own Mac, in colima, against the test database, or on the check fleet’s EC2 hosts when the ship loop’s verify job sends them there (ops/check-fleet/fleet.ts). None runs on gomoe.dev.
Run them
Section titled “Run them”From a copy, with Node from ~/.local/node/bin:
npm run typechecknpm run lintnode test/names.tsnode test/style.tsnpm run typecheck runs tsc for the server and again for the app. The name guard test/names.ts fails on a name the repo may not use. The style guard test/style.ts fails on the design and writing rules. Do not switch a rule off to make either one pass.
To run the step checks, use one of these.
npm run check # the name guard, typecheck, lint, then every stepnpm run check -- 6 9 # the same guards, then only the steps namednode daemon/agents-git/main.ts check <name> 6 9npm run check matches a step id by prefix, so 6 runs step6, step6b and step60. The third command is agents-git check, which takes whole ids such as 6 or 6b and runs exactly test/step<id>.ts. It runs the steps in a slot of their own, from your copy’s own files, and loads the main checkout’s .env and then .env.test. It stops a step that runs past its limit. A step’s limit is the one its // time-limit: <seconds> line names, or the policy’s 900 when it has none, and --limit <seconds> sets one limit for every step. npm run check, the gates and verify read the same line, so a check that waits on busy slots, such as one that needs two of them, can name a longer limit once. It keeps each step’s log in ~/.agents-app/checks/agents-git/<name>, and records what passed in the ledger.
agents-git gates origin/main HEAD runs every gate a script can judge, on your copy’s change, as GitHub does. What every pull request passes lists them.
How a run is isolated
Section titled “How a run is isolated”Each run claims one of three check slots. A slot has its own block of ports, its own Postgres, Electric and forge in colima, and a database named agents_test, made from your checkout’s migrations. The slot’s database and Electric win over the ones in .env.test. Checks never touch the live database, which is named agents. A step run by hand with no slot named uses slot 0, which has the fixed ports, the shared agents_test, and no forge.
When a check you write needs these, follow the rules.
- Take every port the check listens on through
port()fromtest/slot.ts. It accepts 7702 to 8689 and returns the slot’s port. - A step that needs port 7701, the one port besides the API’s that the box firewall opens, names it in a
// shares: port-7701line. The runner takes the lock for that step alone and runs such steps last. Never take~/.agents-app/checks/run.lockby hand. The other shared things a step can name arenetlab-subnetsandfree-slots. - A check that needs no database, forge or Docker can say
// runs-in: boxon its first line. The runner then runs it in a box, so it can watch the check fail onmainbefore any fix. - Prefix the teams your check makes with your workstream’s name, and delete them when you finish.
After a run that builds a Docker image, run node shared/docker-lock.ts prune. Do not run a bare docker image prune. The prune takes the build lock, removes untagged images no container uses, then trims the build cache to 8 GB. Never build or tag agents-box:latest on the developer’s Mac, which AGENTS.md keeps off limits there. gomoe.dev’s computers start from the image that ops/aws-deploy/follow.ts pushes to its registry after each deploy that passes, or that node ops/aws-deploy/deploy.ts --image pushes by hand. A check that builds a box image uses a tag of its own and removes it.
Show that a check fails
Section titled “Show that a check fails”A passing check proves nothing until you have watched it fail. For each check you add or edit, do this.
- Break the thing the check guards. The simplest break is to run the check against
main’s code, where the feature does not exist. - Run the check and read why it failed. The failure must name the broken behavior, not something unrelated.
- Restore the code byte for byte.
- Run the check again and watch it pass.
The gates make the same demand. For a check marked // runs-in: box, the box runs it on main’s code, where it must fail, and on your change, where it must pass. A check that cannot load on main, because it imports what your change adds, counts as failing there.
Install packages
Section titled “Install packages”Install packages in your own copy with npm ci. Never link node_modules from the main checkout. Do not add a script for your check to package.json. The runner finds a check by its file name.