devguard-ai-validator 0.1.2__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DevGuard 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,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: devguard-ai-validator
3
+ Version: 0.1.2
4
+ Summary: AI-generated code validation module built on devguard-core
5
+ Author: DevGuard Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/upendra-manike/developer-problem-solvers
8
+ Project-URL: Repository, https://github.com/upendra-manike/developer-problem-solvers
9
+ Project-URL: Issues, https://github.com/upendra-manike/developer-problem-solvers/issues
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: devguard-core>=0.1.2
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=8.0; extra == "dev"
16
+ Requires-Dist: ruff>=0.8.0; extra == "dev"
17
+ Requires-Dist: build>=1.2.0; extra == "dev"
18
+ Dynamic: license-file
19
+
20
+ # devguard-ai-validator
21
+
22
+ Wedge module for validating AI-generated code.
23
+
24
+ ## Scope (v0.1)
25
+
26
+ - Runs DevGuard core checks
27
+ - Reports confidence-aware findings
28
+ - Supports JSON and SARIF output for CI workflows
29
+
30
+ ## Example
31
+
32
+ ```bash
33
+ PYTHONPATH=../devguard-core/src:src python -m devguard_ai_validator.cli ../../examples/sample_insecure.py --format json
34
+ ```
@@ -0,0 +1,15 @@
1
+ # devguard-ai-validator
2
+
3
+ Wedge module for validating AI-generated code.
4
+
5
+ ## Scope (v0.1)
6
+
7
+ - Runs DevGuard core checks
8
+ - Reports confidence-aware findings
9
+ - Supports JSON and SARIF output for CI workflows
10
+
11
+ ## Example
12
+
13
+ ```bash
14
+ PYTHONPATH=../devguard-core/src:src python -m devguard_ai_validator.cli ../../examples/sample_insecure.py --format json
15
+ ```
@@ -0,0 +1,39 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "devguard-ai-validator"
7
+ version = "0.1.2"
8
+ description = "AI-generated code validation module built on devguard-core"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ authors = [{ name = "DevGuard Contributors" }]
12
+ license = "MIT"
13
+ license-files = ["LICENSE"]
14
+ dependencies = ["devguard-core>=0.1.2"]
15
+
16
+ [project.urls]
17
+ Homepage = "https://github.com/upendra-manike/developer-problem-solvers"
18
+ Repository = "https://github.com/upendra-manike/developer-problem-solvers"
19
+ Issues = "https://github.com/upendra-manike/developer-problem-solvers/issues"
20
+
21
+ [project.optional-dependencies]
22
+ dev = ["pytest>=8.0", "ruff>=0.8.0", "build>=1.2.0"]
23
+
24
+ [project.scripts]
25
+ devguard-ai-validator = "devguard_ai_validator.cli:main"
26
+
27
+ [tool.setuptools]
28
+ package-dir = {"" = "src"}
29
+
30
+ [tool.setuptools.packages.find]
31
+ where = ["src"]
32
+
33
+ [tool.pytest.ini_options]
34
+ addopts = "-q"
35
+ testpaths = ["tests"]
36
+
37
+ [tool.ruff]
38
+ line-length = 100
39
+ target-version = "py310"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ """DevGuard AI validator package."""
@@ -0,0 +1,43 @@
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ from pathlib import Path
5
+
6
+ from devguard_core.formatters import to_json, to_sarif
7
+ from devguard_core.scanner import scan_path
8
+
9
+
10
+ MIN_CONFIDENCE = 0.7
11
+
12
+
13
+ def build_parser() -> argparse.ArgumentParser:
14
+ parser = argparse.ArgumentParser(description="DevGuard AI validator")
15
+ parser.add_argument("target", help="Target file or directory")
16
+ parser.add_argument("--format", choices=["json", "sarif"], default="json")
17
+ parser.add_argument("--min-confidence", type=float, default=MIN_CONFIDENCE)
18
+ parser.add_argument("--output", help="Output file path (optional)")
19
+ return parser
20
+
21
+
22
+ def main() -> int:
23
+ args = build_parser().parse_args()
24
+ target = Path(args.target).resolve()
25
+
26
+ result = scan_path(target)
27
+ filtered = [f for f in result.findings if f.confidence >= args.min_confidence]
28
+
29
+ from devguard_core.models import ScanResult
30
+
31
+ filtered_result = ScanResult(findings=filtered)
32
+ body = to_sarif(filtered_result) if args.format == "sarif" else to_json(filtered_result)
33
+
34
+ if args.output:
35
+ Path(args.output).write_text(body + "\n", encoding="utf-8")
36
+ else:
37
+ print(body)
38
+
39
+ return 1 if filtered_result.total > 0 else 0
40
+
41
+
42
+ if __name__ == "__main__":
43
+ raise SystemExit(main())
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: devguard-ai-validator
3
+ Version: 0.1.2
4
+ Summary: AI-generated code validation module built on devguard-core
5
+ Author: DevGuard Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/upendra-manike/developer-problem-solvers
8
+ Project-URL: Repository, https://github.com/upendra-manike/developer-problem-solvers
9
+ Project-URL: Issues, https://github.com/upendra-manike/developer-problem-solvers/issues
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: devguard-core>=0.1.2
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=8.0; extra == "dev"
16
+ Requires-Dist: ruff>=0.8.0; extra == "dev"
17
+ Requires-Dist: build>=1.2.0; extra == "dev"
18
+ Dynamic: license-file
19
+
20
+ # devguard-ai-validator
21
+
22
+ Wedge module for validating AI-generated code.
23
+
24
+ ## Scope (v0.1)
25
+
26
+ - Runs DevGuard core checks
27
+ - Reports confidence-aware findings
28
+ - Supports JSON and SARIF output for CI workflows
29
+
30
+ ## Example
31
+
32
+ ```bash
33
+ PYTHONPATH=../devguard-core/src:src python -m devguard_ai_validator.cli ../../examples/sample_insecure.py --format json
34
+ ```
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/devguard_ai_validator/__init__.py
5
+ src/devguard_ai_validator/cli.py
6
+ src/devguard_ai_validator.egg-info/PKG-INFO
7
+ src/devguard_ai_validator.egg-info/SOURCES.txt
8
+ src/devguard_ai_validator.egg-info/dependency_links.txt
9
+ src/devguard_ai_validator.egg-info/entry_points.txt
10
+ src/devguard_ai_validator.egg-info/requires.txt
11
+ src/devguard_ai_validator.egg-info/top_level.txt
12
+ tests/test_cli.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ devguard-ai-validator = devguard_ai_validator.cli:main
@@ -0,0 +1,6 @@
1
+ devguard-core>=0.1.2
2
+
3
+ [dev]
4
+ pytest>=8.0
5
+ ruff>=0.8.0
6
+ build>=1.2.0
@@ -0,0 +1,24 @@
1
+ from pathlib import Path
2
+
3
+ from devguard_ai_validator.cli import main
4
+
5
+
6
+ def test_ai_validator_cli_writes_sarif(monkeypatch, tmp_path):
7
+ sample = Path(__file__).resolve().parents[3] / "examples" / "sample_insecure.py"
8
+ output = tmp_path / "report.sarif"
9
+
10
+ argv = [
11
+ "devguard_ai_validator",
12
+ str(sample),
13
+ "--format",
14
+ "sarif",
15
+ "--output",
16
+ str(output),
17
+ ]
18
+ monkeypatch.setattr("sys.argv", argv)
19
+
20
+ exit_code = main()
21
+ assert exit_code == 1
22
+ assert output.exists()
23
+ body = output.read_text(encoding="utf-8")
24
+ assert '"version": "2.1.0"' in body