ai-code-watchdog 0.1.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.
- ai_code_watchdog-0.1.0/LICENSE +21 -0
- ai_code_watchdog-0.1.0/PKG-INFO +259 -0
- ai_code_watchdog-0.1.0/README.md +234 -0
- ai_code_watchdog-0.1.0/pyproject.toml +43 -0
- ai_code_watchdog-0.1.0/setup.cfg +4 -0
- ai_code_watchdog-0.1.0/src/ai_code_guard/__init__.py +2 -0
- ai_code_watchdog-0.1.0/src/ai_code_guard/audit.py +837 -0
- ai_code_watchdog-0.1.0/src/ai_code_guard/cli.py +167 -0
- ai_code_watchdog-0.1.0/src/ai_code_guard/guard_check.py +504 -0
- ai_code_watchdog-0.1.0/src/ai_code_guard/monitor_check.py +333 -0
- ai_code_watchdog-0.1.0/src/ai_code_guard/rules_template.yaml +70 -0
- ai_code_watchdog-0.1.0/src/ai_code_guard/smoke_test.py +601 -0
- ai_code_watchdog-0.1.0/src/ai_code_watchdog.egg-info/PKG-INFO +259 -0
- ai_code_watchdog-0.1.0/src/ai_code_watchdog.egg-info/SOURCES.txt +16 -0
- ai_code_watchdog-0.1.0/src/ai_code_watchdog.egg-info/dependency_links.txt +1 -0
- ai_code_watchdog-0.1.0/src/ai_code_watchdog.egg-info/entry_points.txt +2 -0
- ai_code_watchdog-0.1.0/src/ai_code_watchdog.egg-info/requires.txt +1 -0
- ai_code_watchdog-0.1.0/src/ai_code_watchdog.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ai-code-guard contributors
|
|
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.
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ai-code-watchdog
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI code quality gate: catches AI-slop, complexity spikes, placeholder tests, unsafe shortcuts, and baseline regressions.
|
|
5
|
+
Author: Hermes Agent
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/erikadamil-max/ai-code-guard
|
|
8
|
+
Project-URL: Repository, https://github.com/erikadamil-max/ai-code-guard
|
|
9
|
+
Project-URL: Issues, https://github.com/erikadamil-max/ai-code-guard/issues
|
|
10
|
+
Keywords: ai,code-quality,guardrails,audit,security,technical-debt,monitoring
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: pyyaml>=5.1
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# ai-code-guard
|
|
27
|
+
|
|
28
|
+
**AI code quality gate**: catches AI-slop, complexity spikes, placeholder tests, unsafe shortcuts, and baseline regressions.
|
|
29
|
+
|
|
30
|
+
Built for teams using Cursor, Copilot, Claude Code, Codex, and other AI coding assistants. AI writes code faster than humans can review it; this tool helps close the gap.
|
|
31
|
+
|
|
32
|
+
## Status
|
|
33
|
+
|
|
34
|
+
Beta v0.1. The CLI is usable, covered by smoke tests, and has been validated on one large local mixed Python/JS project. More real-world repository validation is still needed before calling this production hardened.
|
|
35
|
+
|
|
36
|
+
For production-grade security analysis, use it alongside Semgrep, Snyk, GitGuardian, or similar tools. ai-code-guard focuses on AI-specific code quality risks and baseline regressions; it does not find every vulnerability.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
From a local checkout:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/erikadamil-max/ai-code-guard.git
|
|
44
|
+
cd ai-code-guard
|
|
45
|
+
pip install -e .
|
|
46
|
+
ai-code-guard self-test
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
After the first PyPI release, installation will be:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install ai-code-watchdog
|
|
53
|
+
ai-code-guard self-test
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The PyPI distribution is `ai-code-watchdog`; the CLI command is still `ai-code-guard`.
|
|
57
|
+
|
|
58
|
+
## Quickstart
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
cd /path/to/your/project
|
|
62
|
+
|
|
63
|
+
# Create .codeguard/rules.yaml
|
|
64
|
+
ai-code-guard init .
|
|
65
|
+
|
|
66
|
+
# Run a full audit and create a baseline
|
|
67
|
+
ai-code-guard audit .
|
|
68
|
+
|
|
69
|
+
# Check current git changes before commit
|
|
70
|
+
ai-code-guard guard .
|
|
71
|
+
|
|
72
|
+
# Compare current state against the saved baseline
|
|
73
|
+
ai-code-guard monitor .
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Commands
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
ai-code-guard audit [path] Full project audit; scans entire codebase
|
|
80
|
+
ai-code-guard guard [path] Pre-commit guard; checks git diff only
|
|
81
|
+
ai-code-guard monitor [path] Delta vs baseline; reports regressions only
|
|
82
|
+
ai-code-guard init [path] Create .codeguard/rules.yaml from template
|
|
83
|
+
ai-code-guard self-test Run smoke tests
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Flags
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
audit:
|
|
90
|
+
--json Output JSON instead of text report
|
|
91
|
+
--rules PATH Path to custom rules.yaml
|
|
92
|
+
--no-baseline Skip saving baseline
|
|
93
|
+
|
|
94
|
+
guard:
|
|
95
|
+
--json Output JSON
|
|
96
|
+
--skip-tests Skip test suite (faster, security-only)
|
|
97
|
+
--include-untracked Scan untracked files too
|
|
98
|
+
--diff-cmd CMD Custom git diff command
|
|
99
|
+
|
|
100
|
+
monitor:
|
|
101
|
+
--json Output JSON
|
|
102
|
+
--update-baseline Update baseline after reporting
|
|
103
|
+
--rules PATH Path to custom rules.yaml
|
|
104
|
+
|
|
105
|
+
init:
|
|
106
|
+
--force Overwrite existing rules.yaml
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## What It Catches
|
|
110
|
+
|
|
111
|
+
Security:
|
|
112
|
+
|
|
113
|
+
- Hardcoded secrets
|
|
114
|
+
- SQL injection patterns
|
|
115
|
+
- Shell injection patterns
|
|
116
|
+
- Dangerous Python `eval` / `exec`
|
|
117
|
+
- JavaScript `eval()` and `new Function()`
|
|
118
|
+
- Unsafe deserialization
|
|
119
|
+
- DOM XSS sinks such as `innerHTML` as warning by default
|
|
120
|
+
|
|
121
|
+
AI anti-patterns:
|
|
122
|
+
|
|
123
|
+
- Silent exception swallowing
|
|
124
|
+
- Bare `except` blocks
|
|
125
|
+
- Missing error handling on network calls
|
|
126
|
+
- N+1 query patterns
|
|
127
|
+
- Long functions
|
|
128
|
+
- Commented-out code blocks
|
|
129
|
+
- Debug leftovers
|
|
130
|
+
- Mixed naming conventions
|
|
131
|
+
|
|
132
|
+
Testing and complexity:
|
|
133
|
+
|
|
134
|
+
- Placeholder tests such as `assert True` or `pass`-only tests
|
|
135
|
+
- Test-to-source file ratio
|
|
136
|
+
- Functions above `max_function_length`
|
|
137
|
+
- Baseline regressions in monitor mode
|
|
138
|
+
|
|
139
|
+
## Configuration
|
|
140
|
+
|
|
141
|
+
`ai-code-guard init .` creates `.codeguard/rules.yaml`.
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
security:
|
|
145
|
+
block_on_secrets: true
|
|
146
|
+
block_on_sql_injection: true
|
|
147
|
+
|
|
148
|
+
complexity:
|
|
149
|
+
max_function_length: 50
|
|
150
|
+
hotspots_warning_threshold: 10
|
|
151
|
+
|
|
152
|
+
anti_patterns:
|
|
153
|
+
warning_increase_percent: 20
|
|
154
|
+
|
|
155
|
+
testing:
|
|
156
|
+
min_test_ratio: 0.15
|
|
157
|
+
|
|
158
|
+
javascript:
|
|
159
|
+
dom_xss:
|
|
160
|
+
enabled: true
|
|
161
|
+
block_on_innerHTML: false
|
|
162
|
+
|
|
163
|
+
guard_mode:
|
|
164
|
+
block_commit_on_critical: true
|
|
165
|
+
max_fix_cycles: 2
|
|
166
|
+
|
|
167
|
+
allowlist:
|
|
168
|
+
- scripts/smoke_test.py
|
|
169
|
+
|
|
170
|
+
exclude:
|
|
171
|
+
- "**/vendor/**"
|
|
172
|
+
- "**/generated/**"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Exit Codes
|
|
176
|
+
|
|
177
|
+
| Command | 0 | 1 | 2 |
|
|
178
|
+
|---|---|---|---|
|
|
179
|
+
| `audit` | Success | Error | - |
|
|
180
|
+
| `guard` | Safe to commit | Issues found | Could not run |
|
|
181
|
+
| `monitor` | No regressions | Regressions found | No baseline |
|
|
182
|
+
| `self-test` | All tests passed | Tests failed | - |
|
|
183
|
+
|
|
184
|
+
## GitHub Actions
|
|
185
|
+
|
|
186
|
+
Until this repository is published and tagged, install from source in CI:
|
|
187
|
+
|
|
188
|
+
```yaml
|
|
189
|
+
name: AI Code Guard
|
|
190
|
+
on: [push, pull_request]
|
|
191
|
+
|
|
192
|
+
jobs:
|
|
193
|
+
guard:
|
|
194
|
+
runs-on: ubuntu-latest
|
|
195
|
+
steps:
|
|
196
|
+
- uses: actions/checkout@v4
|
|
197
|
+
- uses: actions/setup-python@v5
|
|
198
|
+
- run: pip install -e .
|
|
199
|
+
- run: ai-code-guard guard . --skip-tests
|
|
200
|
+
- run: ai-code-guard audit . --no-baseline --json > guard-report.json
|
|
201
|
+
if: always()
|
|
202
|
+
- uses: actions/upload-artifact@v4
|
|
203
|
+
if: always()
|
|
204
|
+
with:
|
|
205
|
+
name: ai-code-guard-report
|
|
206
|
+
path: guard-report.json
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
After the repository is public and tagged, the composite action can be consumed as:
|
|
210
|
+
|
|
211
|
+
```yaml
|
|
212
|
+
- uses: erikadamil-max/ai-code-guard@v0.1.0
|
|
213
|
+
with:
|
|
214
|
+
mode: guard
|
|
215
|
+
skip-tests: "true"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## pre-commit
|
|
219
|
+
|
|
220
|
+
Local hook configuration. This requires the package to be installed in the environment first:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
pip install ai-code-watchdog
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
```yaml
|
|
227
|
+
repos:
|
|
228
|
+
- repo: local
|
|
229
|
+
hooks:
|
|
230
|
+
- id: ai-code-guard
|
|
231
|
+
name: AI Code Guard
|
|
232
|
+
entry: ai-code-guard guard
|
|
233
|
+
language: system
|
|
234
|
+
pass_filenames: false
|
|
235
|
+
args: ["--skip-tests"]
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Roadmap
|
|
239
|
+
|
|
240
|
+
Currently available as free open-source core:
|
|
241
|
+
|
|
242
|
+
- CLI: `audit`, `guard`, `monitor`, `init`, `self-test`
|
|
243
|
+
- Local project rules
|
|
244
|
+
- Local baseline and JSON reports
|
|
245
|
+
- GitHub Action
|
|
246
|
+
- pre-commit hook
|
|
247
|
+
|
|
248
|
+
Potential hosted layer later:
|
|
249
|
+
|
|
250
|
+
- Team dashboard
|
|
251
|
+
- Trend charts across repositories
|
|
252
|
+
- PR history and analytics
|
|
253
|
+
- Team policy packs
|
|
254
|
+
- Slack or Teams alerts
|
|
255
|
+
- Organization-wide baselines
|
|
256
|
+
|
|
257
|
+
## License
|
|
258
|
+
|
|
259
|
+
MIT
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# ai-code-guard
|
|
2
|
+
|
|
3
|
+
**AI code quality gate**: catches AI-slop, complexity spikes, placeholder tests, unsafe shortcuts, and baseline regressions.
|
|
4
|
+
|
|
5
|
+
Built for teams using Cursor, Copilot, Claude Code, Codex, and other AI coding assistants. AI writes code faster than humans can review it; this tool helps close the gap.
|
|
6
|
+
|
|
7
|
+
## Status
|
|
8
|
+
|
|
9
|
+
Beta v0.1. The CLI is usable, covered by smoke tests, and has been validated on one large local mixed Python/JS project. More real-world repository validation is still needed before calling this production hardened.
|
|
10
|
+
|
|
11
|
+
For production-grade security analysis, use it alongside Semgrep, Snyk, GitGuardian, or similar tools. ai-code-guard focuses on AI-specific code quality risks and baseline regressions; it does not find every vulnerability.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
From a local checkout:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/erikadamil-max/ai-code-guard.git
|
|
19
|
+
cd ai-code-guard
|
|
20
|
+
pip install -e .
|
|
21
|
+
ai-code-guard self-test
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
After the first PyPI release, installation will be:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install ai-code-watchdog
|
|
28
|
+
ai-code-guard self-test
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The PyPI distribution is `ai-code-watchdog`; the CLI command is still `ai-code-guard`.
|
|
32
|
+
|
|
33
|
+
## Quickstart
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd /path/to/your/project
|
|
37
|
+
|
|
38
|
+
# Create .codeguard/rules.yaml
|
|
39
|
+
ai-code-guard init .
|
|
40
|
+
|
|
41
|
+
# Run a full audit and create a baseline
|
|
42
|
+
ai-code-guard audit .
|
|
43
|
+
|
|
44
|
+
# Check current git changes before commit
|
|
45
|
+
ai-code-guard guard .
|
|
46
|
+
|
|
47
|
+
# Compare current state against the saved baseline
|
|
48
|
+
ai-code-guard monitor .
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Commands
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
ai-code-guard audit [path] Full project audit; scans entire codebase
|
|
55
|
+
ai-code-guard guard [path] Pre-commit guard; checks git diff only
|
|
56
|
+
ai-code-guard monitor [path] Delta vs baseline; reports regressions only
|
|
57
|
+
ai-code-guard init [path] Create .codeguard/rules.yaml from template
|
|
58
|
+
ai-code-guard self-test Run smoke tests
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Flags
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
audit:
|
|
65
|
+
--json Output JSON instead of text report
|
|
66
|
+
--rules PATH Path to custom rules.yaml
|
|
67
|
+
--no-baseline Skip saving baseline
|
|
68
|
+
|
|
69
|
+
guard:
|
|
70
|
+
--json Output JSON
|
|
71
|
+
--skip-tests Skip test suite (faster, security-only)
|
|
72
|
+
--include-untracked Scan untracked files too
|
|
73
|
+
--diff-cmd CMD Custom git diff command
|
|
74
|
+
|
|
75
|
+
monitor:
|
|
76
|
+
--json Output JSON
|
|
77
|
+
--update-baseline Update baseline after reporting
|
|
78
|
+
--rules PATH Path to custom rules.yaml
|
|
79
|
+
|
|
80
|
+
init:
|
|
81
|
+
--force Overwrite existing rules.yaml
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## What It Catches
|
|
85
|
+
|
|
86
|
+
Security:
|
|
87
|
+
|
|
88
|
+
- Hardcoded secrets
|
|
89
|
+
- SQL injection patterns
|
|
90
|
+
- Shell injection patterns
|
|
91
|
+
- Dangerous Python `eval` / `exec`
|
|
92
|
+
- JavaScript `eval()` and `new Function()`
|
|
93
|
+
- Unsafe deserialization
|
|
94
|
+
- DOM XSS sinks such as `innerHTML` as warning by default
|
|
95
|
+
|
|
96
|
+
AI anti-patterns:
|
|
97
|
+
|
|
98
|
+
- Silent exception swallowing
|
|
99
|
+
- Bare `except` blocks
|
|
100
|
+
- Missing error handling on network calls
|
|
101
|
+
- N+1 query patterns
|
|
102
|
+
- Long functions
|
|
103
|
+
- Commented-out code blocks
|
|
104
|
+
- Debug leftovers
|
|
105
|
+
- Mixed naming conventions
|
|
106
|
+
|
|
107
|
+
Testing and complexity:
|
|
108
|
+
|
|
109
|
+
- Placeholder tests such as `assert True` or `pass`-only tests
|
|
110
|
+
- Test-to-source file ratio
|
|
111
|
+
- Functions above `max_function_length`
|
|
112
|
+
- Baseline regressions in monitor mode
|
|
113
|
+
|
|
114
|
+
## Configuration
|
|
115
|
+
|
|
116
|
+
`ai-code-guard init .` creates `.codeguard/rules.yaml`.
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
security:
|
|
120
|
+
block_on_secrets: true
|
|
121
|
+
block_on_sql_injection: true
|
|
122
|
+
|
|
123
|
+
complexity:
|
|
124
|
+
max_function_length: 50
|
|
125
|
+
hotspots_warning_threshold: 10
|
|
126
|
+
|
|
127
|
+
anti_patterns:
|
|
128
|
+
warning_increase_percent: 20
|
|
129
|
+
|
|
130
|
+
testing:
|
|
131
|
+
min_test_ratio: 0.15
|
|
132
|
+
|
|
133
|
+
javascript:
|
|
134
|
+
dom_xss:
|
|
135
|
+
enabled: true
|
|
136
|
+
block_on_innerHTML: false
|
|
137
|
+
|
|
138
|
+
guard_mode:
|
|
139
|
+
block_commit_on_critical: true
|
|
140
|
+
max_fix_cycles: 2
|
|
141
|
+
|
|
142
|
+
allowlist:
|
|
143
|
+
- scripts/smoke_test.py
|
|
144
|
+
|
|
145
|
+
exclude:
|
|
146
|
+
- "**/vendor/**"
|
|
147
|
+
- "**/generated/**"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Exit Codes
|
|
151
|
+
|
|
152
|
+
| Command | 0 | 1 | 2 |
|
|
153
|
+
|---|---|---|---|
|
|
154
|
+
| `audit` | Success | Error | - |
|
|
155
|
+
| `guard` | Safe to commit | Issues found | Could not run |
|
|
156
|
+
| `monitor` | No regressions | Regressions found | No baseline |
|
|
157
|
+
| `self-test` | All tests passed | Tests failed | - |
|
|
158
|
+
|
|
159
|
+
## GitHub Actions
|
|
160
|
+
|
|
161
|
+
Until this repository is published and tagged, install from source in CI:
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
name: AI Code Guard
|
|
165
|
+
on: [push, pull_request]
|
|
166
|
+
|
|
167
|
+
jobs:
|
|
168
|
+
guard:
|
|
169
|
+
runs-on: ubuntu-latest
|
|
170
|
+
steps:
|
|
171
|
+
- uses: actions/checkout@v4
|
|
172
|
+
- uses: actions/setup-python@v5
|
|
173
|
+
- run: pip install -e .
|
|
174
|
+
- run: ai-code-guard guard . --skip-tests
|
|
175
|
+
- run: ai-code-guard audit . --no-baseline --json > guard-report.json
|
|
176
|
+
if: always()
|
|
177
|
+
- uses: actions/upload-artifact@v4
|
|
178
|
+
if: always()
|
|
179
|
+
with:
|
|
180
|
+
name: ai-code-guard-report
|
|
181
|
+
path: guard-report.json
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
After the repository is public and tagged, the composite action can be consumed as:
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
- uses: erikadamil-max/ai-code-guard@v0.1.0
|
|
188
|
+
with:
|
|
189
|
+
mode: guard
|
|
190
|
+
skip-tests: "true"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## pre-commit
|
|
194
|
+
|
|
195
|
+
Local hook configuration. This requires the package to be installed in the environment first:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
pip install ai-code-watchdog
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
```yaml
|
|
202
|
+
repos:
|
|
203
|
+
- repo: local
|
|
204
|
+
hooks:
|
|
205
|
+
- id: ai-code-guard
|
|
206
|
+
name: AI Code Guard
|
|
207
|
+
entry: ai-code-guard guard
|
|
208
|
+
language: system
|
|
209
|
+
pass_filenames: false
|
|
210
|
+
args: ["--skip-tests"]
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Roadmap
|
|
214
|
+
|
|
215
|
+
Currently available as free open-source core:
|
|
216
|
+
|
|
217
|
+
- CLI: `audit`, `guard`, `monitor`, `init`, `self-test`
|
|
218
|
+
- Local project rules
|
|
219
|
+
- Local baseline and JSON reports
|
|
220
|
+
- GitHub Action
|
|
221
|
+
- pre-commit hook
|
|
222
|
+
|
|
223
|
+
Potential hosted layer later:
|
|
224
|
+
|
|
225
|
+
- Team dashboard
|
|
226
|
+
- Trend charts across repositories
|
|
227
|
+
- PR history and analytics
|
|
228
|
+
- Team policy packs
|
|
229
|
+
- Slack or Teams alerts
|
|
230
|
+
- Organization-wide baselines
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ai-code-watchdog"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "AI code quality gate: catches AI-slop, complexity spikes, placeholder tests, unsafe shortcuts, and baseline regressions."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Hermes Agent"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["ai", "code-quality", "guardrails", "audit", "security", "technical-debt", "monitoring"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"pyyaml>=5.1",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
ai-code-guard = "ai_code_guard.cli:main"
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/erikadamil-max/ai-code-guard"
|
|
36
|
+
Repository = "https://github.com/erikadamil-max/ai-code-guard"
|
|
37
|
+
Issues = "https://github.com/erikadamil-max/ai-code-guard/issues"
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.packages.find]
|
|
40
|
+
where = ["src"]
|
|
41
|
+
|
|
42
|
+
[tool.setuptools.package-data]
|
|
43
|
+
ai_code_guard = ["rules_template.yaml"]
|