grai-gate 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- grai_gate-0.2.0/LICENSE +24 -0
- grai_gate-0.2.0/PKG-INFO +96 -0
- grai_gate-0.2.0/README.md +78 -0
- grai_gate-0.2.0/pyproject.toml +29 -0
- grai_gate-0.2.0/setup.cfg +4 -0
- grai_gate-0.2.0/src/grai_gate/__init__.py +1 -0
- grai_gate-0.2.0/src/grai_gate/cli.py +20 -0
- grai_gate-0.2.0/src/grai_gate/gate.py +1141 -0
- grai_gate-0.2.0/src/grai_gate.egg-info/PKG-INFO +96 -0
- grai_gate-0.2.0/src/grai_gate.egg-info/SOURCES.txt +12 -0
- grai_gate-0.2.0/src/grai_gate.egg-info/dependency_links.txt +1 -0
- grai_gate-0.2.0/src/grai_gate.egg-info/entry_points.txt +2 -0
- grai_gate-0.2.0/src/grai_gate.egg-info/top_level.txt +1 -0
- grai_gate-0.2.0/tests/test_smoke.py +77 -0
grai_gate-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 grai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
The paid cockpit at grai.page is a separate product and is not covered by
|
|
24
|
+
this license.
|
grai_gate-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: grai-gate
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Deterministic style linter for markdown written by coding agents
|
|
5
|
+
Author-email: Adrian Peticila <adrian@grai.page>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://grai.page?utm_source=pypi&utm_medium=gate&utm_campaign=gate_v0.1#developer
|
|
8
|
+
Project-URL: Repository, https://github.com/adrianpeticila/grai-gate-action
|
|
9
|
+
Project-URL: Issues, https://github.com/adrianpeticila/grai-gate-action/issues
|
|
10
|
+
Keywords: markdown,linter,style-linter,ai-slop,writing,cadence
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
13
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# grai-gate
|
|
20
|
+
|
|
21
|
+
[](https://github.com/marketplace/actions/grai-gate)
|
|
22
|
+
[](https://pypi.org/project/grai-gate/)
|
|
23
|
+
[](https://github.com/adrianpeticila/grai-gate-action)
|
|
24
|
+
|
|
25
|
+
Deterministic style gate for markdown written by coding agents. One Python
|
|
26
|
+
engine, no model calls, no network. It scores sentence burstiness and flags
|
|
27
|
+
structural patterns that survive spellcheck. It is a style gate, not an
|
|
28
|
+
authorship detector.
|
|
29
|
+
|
|
30
|
+
On the v2 corpus (58 human-edited docs, 63 model-generated docs), the gate
|
|
31
|
+
flagged 7 of 63 model docs and 3 of 58 human docs. It catches visible patterns,
|
|
32
|
+
not provenance. Full report: [VALIDATION.md](./VALIDATION.md).
|
|
33
|
+
|
|
34
|
+
## GitHub Action
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
name: cadence
|
|
38
|
+
on:
|
|
39
|
+
pull_request:
|
|
40
|
+
paths: ['**.md', '**.mdx', '**.txt']
|
|
41
|
+
jobs:
|
|
42
|
+
gate:
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
- uses: adrianpeticila/grai-gate-action@v0.2.0
|
|
47
|
+
with:
|
|
48
|
+
fail-on-slop: "false"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The action scores only files changed in the pull request. It fetches the base
|
|
52
|
+
ref itself, so a shallow checkout is fine. The default is advisory: the card
|
|
53
|
+
lands in the log and the job stays green. Set `fail-on-slop: "true"` to block.
|
|
54
|
+
|
|
55
|
+
Inputs: `path` (scan target when no pull request base is available),
|
|
56
|
+
`fail-on-slop`, `verbose`.
|
|
57
|
+
|
|
58
|
+
## Python package
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pipx run grai-gate README.md
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
or
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install grai-gate
|
|
68
|
+
grai-gate docs/
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Exit codes: 0 clean, 1 slop, 2 input error. The CLI accepts `-h` and `--help`.
|
|
72
|
+
|
|
73
|
+
## pre-commit
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
repos:
|
|
77
|
+
- repo: https://github.com/adrianpeticila/grai-gate-action
|
|
78
|
+
rev: v0.2.0
|
|
79
|
+
hooks:
|
|
80
|
+
- id: grai-gate
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The hook scores markdown, mdx, and plain text. It exits 1 on slop and stops the
|
|
84
|
+
commit. Skip one commit with `SKIP=grai-gate git commit`.
|
|
85
|
+
|
|
86
|
+
## One engine
|
|
87
|
+
|
|
88
|
+
`src/grai_gate/gate.py` is vendored byte-for-byte from the Antigravity plugin
|
|
89
|
+
in the grai repo. Run `python scripts/sync_engine.py --check` to prove the
|
|
90
|
+
copies match; it exits 1 on drift.
|
|
91
|
+
|
|
92
|
+
## UTM attribution
|
|
93
|
+
|
|
94
|
+
The report card links to the Pro Cockpit. Attribution resolves from
|
|
95
|
+
`GRAI_UTM_SOURCE`, then `GITHUB_ACTIONS`, then `PRE_COMMIT`. The installed PyPI
|
|
96
|
+
command defaults to `pypi`; a direct engine run defaults to `cli`.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# grai-gate
|
|
2
|
+
|
|
3
|
+
[](https://github.com/marketplace/actions/grai-gate)
|
|
4
|
+
[](https://pypi.org/project/grai-gate/)
|
|
5
|
+
[](https://github.com/adrianpeticila/grai-gate-action)
|
|
6
|
+
|
|
7
|
+
Deterministic style gate for markdown written by coding agents. One Python
|
|
8
|
+
engine, no model calls, no network. It scores sentence burstiness and flags
|
|
9
|
+
structural patterns that survive spellcheck. It is a style gate, not an
|
|
10
|
+
authorship detector.
|
|
11
|
+
|
|
12
|
+
On the v2 corpus (58 human-edited docs, 63 model-generated docs), the gate
|
|
13
|
+
flagged 7 of 63 model docs and 3 of 58 human docs. It catches visible patterns,
|
|
14
|
+
not provenance. Full report: [VALIDATION.md](./VALIDATION.md).
|
|
15
|
+
|
|
16
|
+
## GitHub Action
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
name: cadence
|
|
20
|
+
on:
|
|
21
|
+
pull_request:
|
|
22
|
+
paths: ['**.md', '**.mdx', '**.txt']
|
|
23
|
+
jobs:
|
|
24
|
+
gate:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: adrianpeticila/grai-gate-action@v0.2.0
|
|
29
|
+
with:
|
|
30
|
+
fail-on-slop: "false"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The action scores only files changed in the pull request. It fetches the base
|
|
34
|
+
ref itself, so a shallow checkout is fine. The default is advisory: the card
|
|
35
|
+
lands in the log and the job stays green. Set `fail-on-slop: "true"` to block.
|
|
36
|
+
|
|
37
|
+
Inputs: `path` (scan target when no pull request base is available),
|
|
38
|
+
`fail-on-slop`, `verbose`.
|
|
39
|
+
|
|
40
|
+
## Python package
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pipx run grai-gate README.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
or
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install grai-gate
|
|
50
|
+
grai-gate docs/
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Exit codes: 0 clean, 1 slop, 2 input error. The CLI accepts `-h` and `--help`.
|
|
54
|
+
|
|
55
|
+
## pre-commit
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
repos:
|
|
59
|
+
- repo: https://github.com/adrianpeticila/grai-gate-action
|
|
60
|
+
rev: v0.2.0
|
|
61
|
+
hooks:
|
|
62
|
+
- id: grai-gate
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The hook scores markdown, mdx, and plain text. It exits 1 on slop and stops the
|
|
66
|
+
commit. Skip one commit with `SKIP=grai-gate git commit`.
|
|
67
|
+
|
|
68
|
+
## One engine
|
|
69
|
+
|
|
70
|
+
`src/grai_gate/gate.py` is vendored byte-for-byte from the Antigravity plugin
|
|
71
|
+
in the grai repo. Run `python scripts/sync_engine.py --check` to prove the
|
|
72
|
+
copies match; it exits 1 on drift.
|
|
73
|
+
|
|
74
|
+
## UTM attribution
|
|
75
|
+
|
|
76
|
+
The report card links to the Pro Cockpit. Attribution resolves from
|
|
77
|
+
`GRAI_UTM_SOURCE`, then `GITHUB_ACTIONS`, then `PRE_COMMIT`. The installed PyPI
|
|
78
|
+
command defaults to `pypi`; a direct engine run defaults to `cli`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "grai-gate"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Deterministic style linter for markdown written by coding agents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Adrian Peticila", email = "adrian@grai.page" }]
|
|
13
|
+
keywords = ["markdown", "linter", "style-linter", "ai-slop", "writing", "cadence"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
17
|
+
"Topic :: Text Processing :: Markup :: Markdown",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Homepage = "https://grai.page?utm_source=pypi&utm_medium=gate&utm_campaign=gate_v0.1#developer"
|
|
22
|
+
Repository = "https://github.com/adrianpeticila/grai-gate-action"
|
|
23
|
+
Issues = "https://github.com/adrianpeticila/grai-gate-action/issues"
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
grai-gate = "grai_gate.cli:main"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.packages.find]
|
|
29
|
+
where = ["src"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.0"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Console entry point for the grai-gate package."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from . import gate
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def main():
|
|
10
|
+
if (
|
|
11
|
+
not os.environ.get("GRAI_UTM_SOURCE")
|
|
12
|
+
and not os.environ.get("GITHUB_ACTIONS")
|
|
13
|
+
and not os.environ.get("PRE_COMMIT")
|
|
14
|
+
):
|
|
15
|
+
os.environ["GRAI_UTM_SOURCE"] = "pypi"
|
|
16
|
+
return gate.main()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
if __name__ == "__main__":
|
|
20
|
+
sys.exit(main())
|