gate See a recorded run
CLI · Pythonlive

A merge gate for AI-agent code

Many parallel agent sessions go in; a small number of tested, risk-tiered, provenance-tagged commits come out.

CLI · Python
gate · recorded demo runscreenshot
gate screenshot
2platforms: CLI, Python
26 → 19demo sessions submitted → merged
0broken commits on main in the demo
~400k/daypublish ceiling measured on one laptop
Why it exists

Agents write fast. Main stays green.

Agents never open pull requests.

Run it yourself

Run it on your repo.

From the README’s “Quick start” section. Full options, requirements and troubleshooting are there too.

Open the README
bash
$ pip install git+https://github.com/juw12/gate
$ cd your-repo
$ gate init        # writes gate.toml, detects your test command
$ gate spawn fix-1234
$ gate submit fix-1234 --model <model-id> --tool <agent-tool>
$ gate queue --drain --parallel 8
$ gate verify
How it works

How a change lands

  1. 1

    Spawn

    gate spawn gives an agent its own branch and worktree (or --no-worktree for remote sandboxes that push agent/<id>).

  2. 2

    Submit

    gate submit checks policy: secrets, size and risk tier.

  3. 3

    Queue

    gate queue --drain merges batches with merge-tree, runs the relevant suites and publishes green results.

  4. 4

    Verify

    gate verify runs on a timer; a red target is bisected and the culprit reverted automatically.

What's inside

What the gate does for you.

Lanes

Path-partitioned queues merge and test in parallel (queue --parallel N); only a short publish step is serialized.

Merges without a checkout

Server-style merges with git merge-tree, batched, then published with compare-and-swap: update-ref locally or --force-with-lease to a remote.

Targeted, cached tests

Suites run only when their paths change, in parallel, and pass results are cached by tree. Failing batches are bisected.

Risk tiers

Auth, infra, CI, migrations and the policy file wait for gate approve --by NAME. Changes over max_changed_lines bounce back to the agent.

Secrets blocked

Added lines are scanned at submit time; a hit blocks the merge without echoing the value. Traces and archived diffs are redacted.

Verify and auto-revert

gate verify tests the target; if it is red it bisects back to the last green point, finds the breaking agent commit and publishes a revert.

Provenance on every commit

Agent-Session, Agent-Model, Agent-Tool, Spec, Risk-Tier, Approved-By and more as trailers; author is the agent, committer is gate.

Crash-safe

Heartbeat locks and atomic writes: a gate killed mid-publish leaves no lost or duplicated work, and the next run recovers.

Working today

Already in v0.5.0.

Good to know

Honest limits.

Straight from the README, so you know what you're getting before you try it.

  • Semantic conflicts are caught after the fact by gate verify, not prevented.
  • Secret redaction is best-effort; plug in gitleaks or trufflehog via secret_scan_command for fail-closed coverage.
  • State is files, not a database.
Under the hood

How it's built.

Built with

Language
PythonHTML/CSS
Testing
Automated tests

15 files in the repo · last updated 7 Nov 2026.

Browse the code
Questions

Good questions.

What does it run on?

CLI, Python.

How do I get it running?

The commands in the “Quick start” box above come straight from the README. Paste them into a terminal; the README covers options and troubleshooting.

Can I try it without installing?

There is no browser version.

What doesn't it do yet?

Semantic conflicts are caught after the fact by gate verify, not prevented. Secret redaction is best-effort; plug in gitleaks or trufflehog via secret_scan_command for fail-closed coverage.

Is it finished?

Not yet: it's marked “live” and still changing. The README always has the current state.

Is it free?

The source is public on GitHub under the MIT licence.

Who made it?

Juwen Lie, an R&D mechanical engineer in Batam, Indonesia, as an independent personal project.

Keep exploring

More from the same workbench.

Let the agents queue. Let the gate decide.

A merge gate for AI-agent code