# `mix gate.check`
[🔗](https://github.com/riddler/statifier-ex/blob/v2.1.1/lib/mix/tasks/gate.check.ex#L1)

Reports changes to the quality gate's own configuration that the branch does
not also record in `docs/quality-gate-changes.md`.

ADR-0011 says the gate's config is not agent-editable. This task is how a
`mix quality` run notices: it runs as the `Gate guard` custom stage, and fails
it when a guarded file changed with no ledger entry naming that file.

## Usage

    mix gate.check
    mix gate.check --base upstream/trunk
    mix gate.check --format json

## Options

  * `--base` - ref to diff against, tried before `origin/main` and `main`
  * `--format json` - print the ExQuality finding contract instead of prose

Exit status is 0 when nothing is unjustified, 1 when something is, and 2 when
no base ref resolves and there is nothing to diff against - which the stage's
`skip_exit_code: 2` turns into a skip with its own reason rather than a pass.

# `execute`

```elixir
@spec execute(argv :: [String.t()], opts :: keyword()) ::
  {:ok, iodata()} | {:skip, String.t()} | {:error, iodata()}
```

Runs the guard and reports the outcome instead of halting.

`opts` are passed through to `Mix.Statifier.GateGuard.collect/1`, so
`opts[:runner]` drives this without a real git history.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
