The quality gate¶
Work is checked twice before it merges: by a gate before the pull request, and by a review loop after it.
Before the pull request: two halves¶
| Half | Checks | Runs |
|---|---|---|
| Machine | whatever the build enforces: formatting, static analysis, tests, coverage, mutation | the repository's Machine gate command, from the pre-push hook and again in CI |
| Model | simplify, code review, security review, Aikido scan | workflow:ready (plugins/workflow/skills/ready/SKILL.md) |
The machine half needs no skill: the build runs it, and a push is what runs the build. The model half runs the checks a machine cannot, and fixes what they find. Simplify runs first, so the reviews see the final shape.
The security review goes by stack. After /security-review, workflow:ready checks each changed
file of these kinds against the finding classes in its
security checklist (plugins/workflow/skills/ready/security-checklist.md):
- Python, Java and JavaScript;
- served HTML and header configuration;
- workflows;
- infrastructure as code: Dockerfile, compose, systemd, Cloud Run;
- dependency files.
The checklist holds the kinds of finding Aikido has reported in these repositories, with how each slips in and its safe form.
Which tools make up the machine half depends on the stack. The stack pages
list them topic by topic, for Java / Spring, the
static frontend and
Claude plugins. In a monorepo each stack can have its own
Machine gate, and workflow:ready runs the gate of each stack the branch touches
(Stacks (plugins/workflow/reference/workflow-section.md)).
Every finding gets one verdict: fixed, rejected or escalated. The commit that carries the fixes says which AI suggestions were corrected or turned down.
A green build from before the fixes proves nothing about the state after them, so the gate runs again after the last change. Results are reported as numbers, not adjectives: "mutation score 96 %, threshold 95 %".
After the pull request: the review loop¶
git-flow:babysit-pr (plugins/git-flow/skills/babysit-pr/SKILL.md) watches the pull request
until CI is green and the AI reviewers have spoken. Then it fixes, rejects or escalates each
finding, pushes, and waits again.
- AI reviewers. A pull request opens as a draft. It gets one Copilot review, when it is marked
ready; a fix push is not reviewed again (ci/copilot-review.md).
Where a repository has the
claude-reviewworkflow, Claude reviews the pull request once (ci/claude-review.md). Both are advice, never a required check. The owner can waive either one, for example while Copilot's quota is used up. - Round limits.
- A worker gets 5 fix rounds. When they run out with real, small findings left, the coordinator may allow up to 10 more.
- A bigger finding, or findings that keep circling one design, becomes a follow-up issue instead of another round.
- AI findings get fix rounds for at most 3 Copilot reviews, and after the first only while the checks are not green yet. Later ones go to a follow-up issue, the ledger.
- Every finding gets a verdict, the "Previously missed" ones in a review body too
(git-flow plugin (
plugins/git-flow/README.md)).
- When it stops converging, it hands over to a person rather than pushing on.
Merging¶
A pull request is mergeable when:
- its checks pass;
- Copilot has reviewed it since it was marked ready, or is waived;
- the claude-review run, where there is one, has succeeded or is waived, and its findings are judged;
- no review thread is left unjudged;
- GitHub reports it
CLEAN.
It squash-merges: main gets one commit per pull request, with the PR's title as its subject and
the PR's body as its body. That is the owner's decision in #596, for every pull request:
- A direct merge passes the message every time, so it does not depend on the repository's
settings:
gh pr merge <n> --squash --match-head-commit <head> --subject <title> --body-file <body>. A coordinator'scoordinator mergeruns exactly that (#482), andcoordinator auto-mergepasses the same title and body with--auto. Never a merge commit, a rebase merge,--adminor a bare--auto. - The PR body is the commit body, so its last paragraph is the trailer block:
Co-Authored-Byand any other trailer (git-flow:pull-request). Git reads trailers only there. - Bringing
maininto a PR branch stays a merge, never a rebase. Only the final merge intomainis squashed. History already onmainis not rewritten. - The repository allows only squash merges, with the PR's title and body as the default message
(
.github/rulesets/main.json; the live settings are the owner's). - A squash-merged branch is "not fully merged" for git. Its local copy is deleted only while its
tip is the merged PR's head, by
git update-ref -dwith that head as the old value. Three tools do that:coordinator cleanup, the janitor (the queue entry'sprandhead), anddev-env:dev-doctor's worktree cleanup. A branch with a later commit stays the owner's.
Who merges is a separate question:
- A coordinator merges routine pull requests of its own workers on the owner's standing consent.
- Everything that touches CI,
.github/,.claude/, aCLAUDE.md, hooks, secrets handling,systemd/or an ADR needs the owner's Approve review on GitHub before the coordinator merges it (needs:owner-approval). - The owner alone merges a breaking change, and anything labelled
needs:owner-merge(decisions.md).
coordinator merge-kind <pr> checks the criteria that can be checked, and every open pull request
carries the label of its result.