Metadata-Version: 2.4
Name: grai-gate
Version: 0.1.6
Summary: Deterministic anti-slop linter for markdown written by coding agents
Author-email: Adrian Peticila <adrian@grai.page>
License: MIT
Project-URL: Homepage, https://grai.page?utm_source=pypi&utm_medium=gate&utm_campaign=gate_v0.1#developer
Project-URL: Repository, https://github.com/adrianpeticila/grai-gate-action
Project-URL: Issues, https://github.com/adrianpeticila/grai-gate-action/issues
Keywords: markdown,linter,ai-slop,writing,cadence
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# grai-gate

[![Marketplace](https://img.shields.io/badge/marketplace-grai--gate-6f42c1)](https://github.com/marketplace/actions/grai-gate)
[![PyPI](https://img.shields.io/pypi/v/grai-gate)](https://pypi.org/project/grai-gate/)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen)](https://github.com/adrianpeticila/grai-gate-action)

Deterministic anti-slop gate for markdown written by coding agents. One Python
engine, no model calls, no network. It scores sentence burstiness and flags the
structural habits that survive spellcheck.

## GitHub Action

```yaml
name: cadence
on:
  pull_request:
    paths: ['**.md', '**.mdx', '**.txt']
jobs:
  gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: adrianpeticila/grai-gate-action@v0.1.6
        with:
          fail-on-slop: "false"
```

The action scores only files changed in the pull request. It fetches the base
ref itself, so a shallow checkout is fine. The default is advisory: the card
lands in the log and the job stays green. Set `fail-on-slop: "true"` to block.

Inputs: `path` (scan target when no pull request base is available),
`fail-on-slop`, `verbose`.

## Python package

```bash
pipx run grai-gate README.md
```

or

```bash
pip install grai-gate
grai-gate docs/
```

Exit codes: 0 clean, 1 slop, 2 input error. The CLI accepts `-h` and `--help`.

## pre-commit

```yaml
repos:
  - repo: https://github.com/adrianpeticila/grai-gate-action
    rev: v0.1.6
    hooks:
      - id: grai-gate
```

The hook scores markdown, mdx, and plain text. It exits 1 on slop and stops the
commit. Skip one commit with `SKIP=grai-gate git commit`.

## One engine

`src/grai_gate/gate.py` is vendored byte-for-byte from the Antigravity plugin
in the grai repo. Run `python scripts/sync_engine.py --check` to prove the
copies match; it exits 1 on drift.

## UTM attribution

The report card links to the Pro Cockpit. Attribution resolves from
`GRAI_UTM_SOURCE`, then `GITHUB_ACTIONS`, then `PRE_COMMIT`. The installed PyPI
command defaults to `pypi`; a direct engine run defaults to `cli`.
