Skip to main content

Gates

Gates are deterministic checks that run after a step completes. No LLM in the loop — gates use your project’s build tools and test runners.

Declaring gates

- name: impl
  agent: claude-sonnet
  gate: [compile, test, lint]
Gates execute in order. All results are collected (no short-circuit) so the agent sees every failure on retry.

Built-in gates

Shell aliases

These resolve automatically based on your project type, or you can override them in gump.toml.
GateGoNodeRust
compilego build ./...npm run buildcargo build
testgo test ./...npm testcargo test
lintgolangci-lint runnpm run lintcargo clippy
coverage: Ngo test -covernpm test -- --coveragecargo tarpaulin
compile and test fail if they can’t be resolved (no go.mod, package.json, or Cargo.toml found). lint and coverage are skipped silently if the tool isn’t available — they’re optional quality checks.

Structural gates

GateWhat it checks
schemaThe plan output is valid JSON with the expected format (array of items with name and description)
touched: "glob"At least one file matching the glob was modified in the diff
untouched: "glob"No file matching the glob was modified in the diff
tests_foundThe test runner finds and recognizes tests to execute
Globs are matched on the filename (basename), not the full path. "*_test.*" matches pkg/auth/middleware_test.go.

Custom gates

gate: ["bash: make integration-test"]
Runs any shell command. Exit 0 = pass, non-zero = fail. Stderr is captured as error context for retries.

Combining gates

Gates are a list. Use as many as you need:
gate: [compile, test, "untouched: *_test.*", "coverage: 80", "bash: make smoke"]

Overriding detection

If auto-detection picks the wrong commands, override in gump.toml:
[validation]
compile_cmd = "make build-affected"
test_cmd = "make test-unit"
lint_cmd = "golangci-lint run --timeout 5m"
Config overrides apply to all workflows in the project.

What happens when a gate fails

Without on_failure, a gate failure is fatal — the run stops. With on_failure, Gump retries, escalates, or restarts from an earlier step. See the Failure Handling page for details. On retry, Gump injects the failed diff and the gate’s error output into the agent’s context via {error} and {diff}. The agent sees exactly what went wrong.