Skip to content

What every pull request passes

GitHub runs one workflow, ship, on each ready pull request. Every job runs on a self-hosted runner. A first job, route, picks the runner for gates. Then four stages run in order, gates, review, verify and land. Each runs an agents-git command that sets a check run on the pull request’s head commit. A job fails closed unless the stage before it left a pass marker for the same head. The workflow runs as main has it, never as the pull request has it, so a branch cannot rewrite the stages that judge it. A draft pull request runs no stage.

The pull request’s policy is ops/policies/agents.json. The rest of this page says what that file asks for.

agents/gates covers everything a script can judge, before any model reads the change. agents-git gates runs these.

  • The static gates, on the diff from the merge base, with the policy from main. What the runner checks on a change lists each one.
  • The pull request text rules from Send a change through the loop.
  • A scan of each new commit and of the pull request’s text for secrets, personal details and banned names.
  • The box commands, which are typecheck, typecheck-app, lint, style, names, enforcement, which is test/step0.ts, and routes, which is test/step37.ts, so every route, shape, page and agent tool needs its line in the feature map’s surface.json. They run with main’s copy of the lint and compiler config, test/names.ts, test/step0.ts, test/style.ts and the policy, so a change cannot loosen what judges it. test/step37.ts runs from the change’s own head, so a change that fixes the route detector is judged by its fix.
  • Each changed check that carries // runs-in: box, run on main’s code, where it must fail, and on the change, where it must pass.

agents/review is a review by Codex, on a different model than the one a commit’s Co-Authored-By trailer names. Codex reads the change in a clean, read-only copy of main, with the brief in .claude/skills/review.md and the pull request’s text, and answers in a fixed shape. The brief tells it to read AGENTS.md and the coding standards first, and to judge the change by them. A regression is always blocking, and so is a bug, a check that cannot fail for the defect it names, and a security, auth, billing, data, migration or concurrency problem.

  • The findings go on the pull request as a review, and the blocking ones sit on their lines.
  • A model with no room gets one more try after a wait, then the fallback model. If neither answers, the line stops.
  • Codex’s usage limit on the account stops the line on the try that hits it, since the fallback model shares the login. The stop names the limit, gives the time Codex said and the command that starts the review again. The session has nothing to fix, and a person starts the run again. A limit on one model gets the usual tries.
  • A patch that already has a review keeps it, so the same change is not asked twice.
  • The reviewer reads the diff of each protected path in full and names each one in its answer. agents-git review refuses an answer that leaves one out.
  • A finding about security, auth, billing, data, migrations or concurrency is judged like any other, and a blocking one stops the land until a fix has been reviewed again.

agents/verdict is a verdict from a fresh agent on Claude, on another model than the author’s. It drives the change on a private copy of Agents, with a database of its own, using main’s verify-agents skill and feature map. It gives a verdict for each feature the change touches. The verdict must reach the policy’s floor for what the change touches.

  • A change to code needs unit-test-verified.
  • A change to documents only needs none.
  • A change under app/ or desktop/ needs live-ui-verified. A feature it touches whose file on main has no step run with bin/agentsctl browser or bin/agentsctl desktop has no screen to drive, so that feature needs live-api-verified, unless the change touches one of that feature’s own paths under app/ or desktop/, no other feature it touches needs live-ui-verified, or its map takes a changed path from the feature main gives it to. A feature new on the branch needs live-ui-verified.

When main moves under a pull request that passed, verify runs again, but a check’s pass can stand. It stands when main’s rule files are unchanged, land’s merge of the new main into the head the check passed on gives this head’s tree, and main’s change touched neither the check’s own file nor a path of a feature that lists it. Any change of the pull request’s own runs every check again. A path no feature lists keeps no pass, unless it is under docs/ or is a step file. The loop’s own tools, the policy, a rule file, a package file and a file under test/ that is no step file each keep no pass either. A check that runs again runs in full, and the verdict names each group of passes it kept, with main’s two commits, and each that ran again, with why. A walk stands only on the same merge base, or across a move of main by docs, the loop’s files and step files nothing an instance runs names.

The evidence goes to a verify-evidence artifact on the workflow run.

land reads every open pull request that is not a draft, oldest first. It squash-merges the oldest one whose agents/gates, agents/review and agents/verdict have passed on a head up to date with main. It skips one with a failed check, and one whose checks still run keeps no other from landing. Each pass needs a seal that only a run of main’s ship.yaml can upload, since a pull request’s own workflow can set a check run too.

  • A pull request behind main is brought up to date with a merge that land makes itself, and its stages run again. A conflict in a file the policy lists as append-only is resolved by joining both sides’ lines. Any other conflict stops that pull request for a person and names each file. One that is already up to date with main still lands.
  • With none to merge, land brings up to date the oldest pull request that passed, unless an older one is up to date and still running. After a land it brings up to date the oldest other one that passed or, with none, the oldest with no failed check, and the follow workflow pulls main into the main checkout.

No person waits in this line. The author runs agents-git finish --ready, which pushes and marks the pull request ready, and the loop does the rest.

The whole suite, npm run check, does not run on each pull request. agents-git nightly runs it on GitHub’s main unless that tree already has a pass, records a pass by tree in ~/.agents-app/ship/suite-passes.jsonl, and opens one issue for each red tree. agents-git suite --ref <commit> runs it on any commit and records a pass the same way. agents-git suite <pr> --budget <seconds> runs it on what the squash merge would put on main, in two parts, and starts only when more than 30% of memory is free.

A change that touches a protected path is named for the reviewer, with its diff. The policy lists them under protectedPaths. They fall into these groups.

  • The rules agents read, such as AGENTS.md, CLAUDE.md and .claude/**.
  • The lint, compiler and package config, such as eslint.config.js, tsconfig*.json and package.json.
  • The checks that guard the rules, such as test/names.ts and test/style.ts.
  • The framework’s own code, under shared/gates/ and in files such as shared/policy.ts and server/runner.ts.
  • The loop’s own tools, under daemon/agents-git/, its hooks folder included. These are the gates, review, verify and land commands and the session hooks.
  • The schema, in server/migrations/.
  • The sandbox and deploy files, under ops/, box/ and in compose.yaml.
  • The workflows GitHub runs the loop from, under .github/.

GitHub refuses a push that changes .github/workflows from a login that may not change workflows, and finish says so.

main changes only through a pull request on GitHub, and branch protection holds that for everyone, admins included. The before-tool hook refuses gh pr merge and a push to main in a copy. Only land merges.