deploy-guard-engine 0.1.1__tar.gz → 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.
Files changed (95) hide show
  1. deploy_guard_engine-0.1.2/PKG-INFO +37 -0
  2. deploy_guard_engine-0.1.2/README.md +3 -0
  3. {deploy_guard_engine-0.1.1 → deploy_guard_engine-0.1.2}/pyproject.toml +11 -8
  4. deploy_guard_engine-0.1.2/setup.cfg +4 -0
  5. deploy_guard_engine-0.1.2/src/deploy_guard/__init__.py +3 -0
  6. deploy_guard_engine-0.1.2/src/deploy_guard/__main__.py +1 -0
  7. deploy_guard_engine-0.1.2/src/deploy_guard/analysis/__init__.py +1 -0
  8. deploy_guard_engine-0.1.2/src/deploy_guard/analysis/callgraph.py +1 -0
  9. deploy_guard_engine-0.1.2/src/deploy_guard/analysis/context.py +1 -0
  10. deploy_guard_engine-0.1.2/src/deploy_guard/analysis/findings.py +1 -0
  11. deploy_guard_engine-0.1.2/src/deploy_guard/analysis/nullability.py +1 -0
  12. deploy_guard_engine-0.1.2/src/deploy_guard/analysis/paths.py +1 -0
  13. deploy_guard_engine-0.1.2/src/deploy_guard/cli.py +43 -0
  14. deploy_guard_engine-0.1.2/src/deploy_guard/config.py +1 -0
  15. deploy_guard_engine-0.1.2/src/deploy_guard/engine.py +1 -0
  16. deploy_guard_engine-0.1.2/src/deploy_guard/explain/__init__.py +1 -0
  17. deploy_guard_engine-0.1.2/src/deploy_guard/explain/explainer.py +1 -0
  18. deploy_guard_engine-0.1.2/src/deploy_guard/explain/render.py +1 -0
  19. deploy_guard_engine-0.1.2/src/deploy_guard/explain/traceback_parse.py +1 -0
  20. deploy_guard_engine-0.1.2/src/deploy_guard/frontend/__init__.py +1 -0
  21. deploy_guard_engine-0.1.2/src/deploy_guard/frontend/python_cfg.py +1 -0
  22. deploy_guard_engine-0.1.2/src/deploy_guard/frontend/python_frontend.py +1 -0
  23. deploy_guard_engine-0.1.2/src/deploy_guard/generators/__init__.py +1 -0
  24. deploy_guard_engine-0.1.2/src/deploy_guard/generators/base.py +1 -0
  25. deploy_guard_engine-0.1.2/src/deploy_guard/generators/import_smoke.py +1 -0
  26. deploy_guard_engine-0.1.2/src/deploy_guard/ingest/__init__.py +1 -0
  27. deploy_guard_engine-0.1.2/src/deploy_guard/ingest/discover.py +1 -0
  28. deploy_guard_engine-0.1.2/src/deploy_guard/ir/__init__.py +1 -0
  29. deploy_guard_engine-0.1.2/src/deploy_guard/ir/cfg.py +1 -0
  30. deploy_guard_engine-0.1.2/src/deploy_guard/ir/model.py +1 -0
  31. deploy_guard_engine-0.1.2/src/deploy_guard/report/__init__.py +1 -0
  32. deploy_guard_engine-0.1.2/src/deploy_guard/report/render.py +1 -0
  33. deploy_guard_engine-0.1.2/src/deploy_guard/store.py +1 -0
  34. deploy_guard_engine-0.1.2/src/deploy_guard_engine.egg-info/PKG-INFO +37 -0
  35. deploy_guard_engine-0.1.2/src/deploy_guard_engine.egg-info/SOURCES.txt +39 -0
  36. deploy_guard_engine-0.1.2/src/deploy_guard_engine.egg-info/dependency_links.txt +1 -0
  37. deploy_guard_engine-0.1.2/src/deploy_guard_engine.egg-info/entry_points.txt +3 -0
  38. deploy_guard_engine-0.1.2/src/deploy_guard_engine.egg-info/requires.txt +7 -0
  39. deploy_guard_engine-0.1.2/src/deploy_guard_engine.egg-info/top_level.txt +1 -0
  40. deploy_guard_engine-0.1.1/.github/workflows/ci.yml +0 -37
  41. deploy_guard_engine-0.1.1/.github/workflows/publish.yml +0 -24
  42. deploy_guard_engine-0.1.1/.gitignore +0 -19
  43. deploy_guard_engine-0.1.1/CHANGELOG.md +0 -52
  44. deploy_guard_engine-0.1.1/PKG-INFO +0 -175
  45. deploy_guard_engine-0.1.1/README.md +0 -142
  46. deploy_guard_engine-0.1.1/docs/architecture.html +0 -570
  47. deploy_guard_engine-0.1.1/docs/deploy-guard-KT.pptx +0 -0
  48. deploy_guard_engine-0.1.1/examples/sample_service/__init__.py +0 -1
  49. deploy_guard_engine-0.1.1/examples/sample_service/broken.py +0 -4
  50. deploy_guard_engine-0.1.1/examples/sample_service/handlers.py +0 -16
  51. deploy_guard_engine-0.1.1/examples/sample_service/lookup.py +0 -27
  52. deploy_guard_engine-0.1.1/examples/sample_service/pricing.py +0 -31
  53. deploy_guard_engine-0.1.1/scripts/build-standalone.sh +0 -25
  54. deploy_guard_engine-0.1.1/scripts/make_kt_deck.py +0 -403
  55. deploy_guard_engine-0.1.1/src/deploy_guard/__init__.py +0 -10
  56. deploy_guard_engine-0.1.1/src/deploy_guard/__main__.py +0 -4
  57. deploy_guard_engine-0.1.1/src/deploy_guard/analysis/__init__.py +0 -39
  58. deploy_guard_engine-0.1.1/src/deploy_guard/analysis/callgraph.py +0 -149
  59. deploy_guard_engine-0.1.1/src/deploy_guard/analysis/context.py +0 -31
  60. deploy_guard_engine-0.1.1/src/deploy_guard/analysis/findings.py +0 -333
  61. deploy_guard_engine-0.1.1/src/deploy_guard/analysis/nullability.py +0 -461
  62. deploy_guard_engine-0.1.1/src/deploy_guard/analysis/paths.py +0 -219
  63. deploy_guard_engine-0.1.1/src/deploy_guard/cli.py +0 -190
  64. deploy_guard_engine-0.1.1/src/deploy_guard/config.py +0 -72
  65. deploy_guard_engine-0.1.1/src/deploy_guard/engine.py +0 -270
  66. deploy_guard_engine-0.1.1/src/deploy_guard/explain/__init__.py +0 -16
  67. deploy_guard_engine-0.1.1/src/deploy_guard/explain/explainer.py +0 -504
  68. deploy_guard_engine-0.1.1/src/deploy_guard/explain/render.py +0 -60
  69. deploy_guard_engine-0.1.1/src/deploy_guard/explain/traceback_parse.py +0 -89
  70. deploy_guard_engine-0.1.1/src/deploy_guard/frontend/__init__.py +0 -10
  71. deploy_guard_engine-0.1.1/src/deploy_guard/frontend/python_cfg.py +0 -332
  72. deploy_guard_engine-0.1.1/src/deploy_guard/frontend/python_frontend.py +0 -182
  73. deploy_guard_engine-0.1.1/src/deploy_guard/generators/__init__.py +0 -11
  74. deploy_guard_engine-0.1.1/src/deploy_guard/generators/base.py +0 -12
  75. deploy_guard_engine-0.1.1/src/deploy_guard/generators/import_smoke.py +0 -94
  76. deploy_guard_engine-0.1.1/src/deploy_guard/ingest/__init__.py +0 -5
  77. deploy_guard_engine-0.1.1/src/deploy_guard/ingest/discover.py +0 -166
  78. deploy_guard_engine-0.1.1/src/deploy_guard/ir/__init__.py +0 -24
  79. deploy_guard_engine-0.1.1/src/deploy_guard/ir/cfg.py +0 -114
  80. deploy_guard_engine-0.1.1/src/deploy_guard/ir/model.py +0 -128
  81. deploy_guard_engine-0.1.1/src/deploy_guard/report/__init__.py +0 -5
  82. deploy_guard_engine-0.1.1/src/deploy_guard/report/render.py +0 -262
  83. deploy_guard_engine-0.1.1/src/deploy_guard/store.py +0 -50
  84. deploy_guard_engine-0.1.1/tests/__init__.py +0 -0
  85. deploy_guard_engine-0.1.1/tests/conftest.py +0 -10
  86. deploy_guard_engine-0.1.1/tests/helpers.py +0 -25
  87. deploy_guard_engine-0.1.1/tests/test_discover.py +0 -62
  88. deploy_guard_engine-0.1.1/tests/test_engine_and_cli.py +0 -65
  89. deploy_guard_engine-0.1.1/tests/test_explain.py +0 -157
  90. deploy_guard_engine-0.1.1/tests/test_interprocedural.py +0 -190
  91. deploy_guard_engine-0.1.1/tests/test_nullability.py +0 -150
  92. deploy_guard_engine-0.1.1/tests/test_paths_and_findings.py +0 -121
  93. deploy_guard_engine-0.1.1/tests/test_python_cfg.py +0 -77
  94. {deploy_guard_engine-0.1.1 → deploy_guard_engine-0.1.2}/LICENSE +0 -0
  95. {deploy_guard_engine-0.1.1 → deploy_guard_engine-0.1.2}/src/deploy_guard/py.typed +0 -0
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.4
2
+ Name: deploy-guard-engine
3
+ Version: 0.1.2
4
+ Summary: Static root-cause analysis for a Python stack trace - offline, no account. Plus a deployment-gate scanner.
5
+ Author: sai55387
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Dineshsai7/deploy-guard-engine
8
+ Project-URL: Issues, https://github.com/Dineshsai7/deploy-guard-engine/issues
9
+ Project-URL: Changelog, https://github.com/Dineshsai7/deploy-guard-engine/blob/main/CHANGELOG.md
10
+ Keywords: traceback,stacktrace,root-cause,debugging,static-analysis,control-flow,nullability,deployment,ci,incident
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Debuggers
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Classifier: Topic :: Software Development :: Testing
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=7.0; extra == "dev"
29
+ Requires-Dist: pytest-cov; extra == "dev"
30
+ Requires-Dist: ruff; extra == "dev"
31
+ Requires-Dist: build; extra == "dev"
32
+ Requires-Dist: twine; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # deploy-guard-engine
36
+
37
+ This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access.
@@ -0,0 +1,3 @@
1
+ # deploy-guard-engine
2
+
3
+ This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access.
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deploy-guard-engine"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "Static root-cause analysis for a Python stack trace - offline, no account. Plus a deployment-gate scanner."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -36,16 +36,19 @@ dependencies = []
36
36
  dev = ["pytest>=7.0", "pytest-cov", "ruff", "build", "twine"]
37
37
 
38
38
  [project.urls]
39
- Homepage = "https://github.com/sai55387/deploy-guard"
40
- Issues = "https://github.com/sai55387/deploy-guard/issues"
41
- Changelog = "https://github.com/sai55387/deploy-guard/blob/main/CHANGELOG.md"
39
+ Homepage = "https://github.com/Dineshsai7/deploy-guard-engine"
40
+ Issues = "https://github.com/Dineshsai7/deploy-guard-engine/issues"
41
+ Changelog = "https://github.com/Dineshsai7/deploy-guard-engine/blob/main/CHANGELOG.md"
42
42
 
43
43
  [project.scripts]
44
44
  deploy-guard = "deploy_guard.cli:main"
45
45
  dg = "deploy_guard.cli:main"
46
46
 
47
- [tool.hatch.build.targets.wheel]
48
- packages = ["src/deploy_guard"]
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+
50
+ [tool.setuptools.package-dir]
51
+ "" = "src"
49
52
 
50
53
  [tool.pytest.ini_options]
51
54
  testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """Placeholder public build - see README."""
2
+
3
+ __version__ = "0.1.2"
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1,43 @@
1
+ """``deploy-guard`` command-line interface (placeholder public build - see README).
2
+ """
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import sys
8
+
9
+ from deploy_guard import __version__
10
+
11
+ _NOTICE = 'This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access.'
12
+
13
+
14
+ def build_parser() -> argparse.ArgumentParser:
15
+ parser = argparse.ArgumentParser(prog="deploy-guard", description=__doc__)
16
+ parser.add_argument("--version", action="version", version=f"deploy-guard {__version__}")
17
+ sub = parser.add_subparsers(dest="command")
18
+ for name, help_ in (
19
+ ("scan", "analyse and report (never fails the build)"),
20
+ ("check", "deployment gate - exit non-zero on blockers"),
21
+ ("explain", "explain a pasted traceback using the project's analysis"),
22
+ ("version", "print version"),
23
+ ):
24
+ p = sub.add_parser(name, help=help_)
25
+ p.add_argument("path", nargs="?", default=".")
26
+ return parser
27
+
28
+
29
+ def main(argv: list[str] | None = None) -> int:
30
+ parser = build_parser()
31
+ args = parser.parse_args(argv)
32
+ if args.command == "version" or args.command is None:
33
+ print(f"deploy-guard {__version__}")
34
+ if args.command is None:
35
+ print(_NOTICE, file=sys.stderr)
36
+ return 2
37
+ return 0
38
+ print(_NOTICE, file=sys.stderr)
39
+ return 3
40
+
41
+
42
+ if __name__ == "__main__":
43
+ raise SystemExit(main())
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1 @@
1
+ """Placeholder public build - see README. This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access."""
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.4
2
+ Name: deploy-guard-engine
3
+ Version: 0.1.2
4
+ Summary: Static root-cause analysis for a Python stack trace - offline, no account. Plus a deployment-gate scanner.
5
+ Author: sai55387
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Dineshsai7/deploy-guard-engine
8
+ Project-URL: Issues, https://github.com/Dineshsai7/deploy-guard-engine/issues
9
+ Project-URL: Changelog, https://github.com/Dineshsai7/deploy-guard-engine/blob/main/CHANGELOG.md
10
+ Keywords: traceback,stacktrace,root-cause,debugging,static-analysis,control-flow,nullability,deployment,ci,incident
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Debuggers
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Classifier: Topic :: Software Development :: Testing
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=7.0; extra == "dev"
29
+ Requires-Dist: pytest-cov; extra == "dev"
30
+ Requires-Dist: ruff; extra == "dev"
31
+ Requires-Dist: build; extra == "dev"
32
+ Requires-Dist: twine; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # deploy-guard-engine
36
+
37
+ This published build of deploy-guard-engine is a placeholder - it reserves the package name but contains no analysis logic. The working tool is distributed privately; contact the maintainer for access.
@@ -0,0 +1,39 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/deploy_guard/__init__.py
5
+ src/deploy_guard/__main__.py
6
+ src/deploy_guard/cli.py
7
+ src/deploy_guard/config.py
8
+ src/deploy_guard/engine.py
9
+ src/deploy_guard/py.typed
10
+ src/deploy_guard/store.py
11
+ src/deploy_guard/analysis/__init__.py
12
+ src/deploy_guard/analysis/callgraph.py
13
+ src/deploy_guard/analysis/context.py
14
+ src/deploy_guard/analysis/findings.py
15
+ src/deploy_guard/analysis/nullability.py
16
+ src/deploy_guard/analysis/paths.py
17
+ src/deploy_guard/explain/__init__.py
18
+ src/deploy_guard/explain/explainer.py
19
+ src/deploy_guard/explain/render.py
20
+ src/deploy_guard/explain/traceback_parse.py
21
+ src/deploy_guard/frontend/__init__.py
22
+ src/deploy_guard/frontend/python_cfg.py
23
+ src/deploy_guard/frontend/python_frontend.py
24
+ src/deploy_guard/generators/__init__.py
25
+ src/deploy_guard/generators/base.py
26
+ src/deploy_guard/generators/import_smoke.py
27
+ src/deploy_guard/ingest/__init__.py
28
+ src/deploy_guard/ingest/discover.py
29
+ src/deploy_guard/ir/__init__.py
30
+ src/deploy_guard/ir/cfg.py
31
+ src/deploy_guard/ir/model.py
32
+ src/deploy_guard/report/__init__.py
33
+ src/deploy_guard/report/render.py
34
+ src/deploy_guard_engine.egg-info/PKG-INFO
35
+ src/deploy_guard_engine.egg-info/SOURCES.txt
36
+ src/deploy_guard_engine.egg-info/dependency_links.txt
37
+ src/deploy_guard_engine.egg-info/entry_points.txt
38
+ src/deploy_guard_engine.egg-info/requires.txt
39
+ src/deploy_guard_engine.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ deploy-guard = deploy_guard.cli:main
3
+ dg = deploy_guard.cli:main
@@ -0,0 +1,7 @@
1
+
2
+ [dev]
3
+ pytest>=7.0
4
+ pytest-cov
5
+ ruff
6
+ build
7
+ twine
@@ -1,37 +0,0 @@
1
- name: ci
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
-
8
- jobs:
9
- test:
10
- runs-on: ubuntu-latest
11
- strategy:
12
- matrix:
13
- python-version: ["3.10", "3.11", "3.12", "3.13"]
14
- steps:
15
- - uses: actions/checkout@v4
16
- - uses: actions/setup-python@v5
17
- with:
18
- python-version: ${{ matrix.python-version }}
19
- - run: python -m pip install --upgrade pip
20
- - run: pip install -e ".[dev]"
21
- - run: ruff check src
22
- - run: pytest -q
23
-
24
- build:
25
- runs-on: ubuntu-latest
26
- needs: test
27
- steps:
28
- - uses: actions/checkout@v4
29
- - uses: actions/setup-python@v5
30
- with:
31
- python-version: "3.12"
32
- - run: pip install build
33
- - run: python -m build
34
- - uses: actions/upload-artifact@v4
35
- with:
36
- name: dist
37
- path: dist/
@@ -1,24 +0,0 @@
1
- name: publish
2
-
3
- # Publishes to PyPI on a tagged release using Trusted Publishing (OIDC) -
4
- # no API token needed. Configure the publisher at
5
- # https://pypi.org/manage/project/deploy-guard/settings/publishing/
6
-
7
- on:
8
- release:
9
- types: [published]
10
-
11
- jobs:
12
- publish:
13
- runs-on: ubuntu-latest
14
- environment: pypi
15
- permissions:
16
- id-token: write
17
- steps:
18
- - uses: actions/checkout@v4
19
- - uses: actions/setup-python@v5
20
- with:
21
- python-version: "3.12"
22
- - run: pip install build
23
- - run: python -m build
24
- - uses: pypa/gh-action-pypi-publish@release/v1
@@ -1,19 +0,0 @@
1
- __pycache__/
2
- *.py[cod]
3
- *.egg-info/
4
- .eggs/
5
- build/
6
- dist/
7
- .venv/
8
- venv/
9
- deploy_guard_env/
10
- deployguard_env/
11
- .pytest_cache/
12
- .mypy_cache/
13
- .ruff_cache/
14
- .coverage
15
- htmlcov/
16
- .idea/
17
- .vscode/
18
- .deploy-guard/cache/
19
- .deploy-guard/*.log
@@ -1,52 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented here.
4
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
-
6
- ## [0.1.0] - 2026-09-01
7
-
8
- First public release. Reworked from an internal prototype ("deployguard").
9
-
10
- ### Added
11
- - **Interprocedural call graph** (`deploy_guard.analysis.callgraph`) - best-effort
12
- resolution of intra-project calls by qualified name, bare name, and
13
- `Class.method` suffix.
14
- - **Caller-aware `inconsistent-return`** - a value/None function is only `review`
15
- when an in-project caller dereferences or returns the result without a guard;
16
- otherwise it drops to a `note`. Kills the copy-pasted-helper false-positive
17
- flood.
18
- - **Interprocedural nullability** - a call that resolves to a project function
19
- which can return `None` now makes the result nullable, so
20
- `x = compute(); x.attr` is flagged when `compute()` is a local function.
21
- - **`explain` walks the whole call chain** - every project frame in the
22
- traceback is analysed, not just the deepest.
23
- - **Configuration file** - `[tool.deploy-guard]` in the scanned project's
24
- `pyproject.toml` (Python 3.11+ for TOML reading). CLI flags override.
25
- - Packaging: `LICENSE` (MIT), trove classifiers, `dg` short alias, this
26
- changelog, a standalone single-file build.
27
-
28
- ### Changed
29
- - Renamed distribution to **`deploy-guard`** (import package `deploy_guard`);
30
- `deployguard` was already taken on PyPI.
31
- - README leads with `explain`; `scan` is positioned as a supporting gate, with
32
- a pointer to ruff + mypy for general linting.
33
-
34
- ### Carried over from the prototype
35
- - Python frontend, CFG builder (`if`/`while`/`for`/`with`/`try`/`match` + async),
36
- path enumeration -> behavior spec.
37
- - Flow-sensitive nullability with `is None` / truthiness / `isinstance` guards,
38
- early-return guards, short-circuit narrowing in `and`/`or`/ternary, `.get()`
39
- and `re.match/search` sources, `Optional[...]` params.
40
- - Findings: `none-dereference`, `swallowed-exception`, `unreachable-code`,
41
- `bare-except`, `mutable-default-arg`, `invalid-escape`, `path-explosion`.
42
- - Import-smoke test generator.
43
- - `explain` traceback parser with dedicated handlers for AttributeError,
44
- TypeError, KeyError, IndexError, ZeroDivisionError, UnboundLocalError,
45
- NameError, ValueError; the "checks in the wrong order" special case.
46
- - Text / Markdown / JSON output, duplicate-finding collapse, `--disable`.
47
-
48
- ### Known limitations
49
- - Python only (a Java frontend would reuse the analysis unchanged).
50
- - Call resolution is name-based, not full import resolution - ambiguous names
51
- stay unresolved.
52
- - No Z3-backed concrete repro inputs yet.
@@ -1,175 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: deploy-guard-engine
3
- Version: 0.1.1
4
- Summary: Static root-cause analysis for a Python stack trace - offline, no account. Plus a deployment-gate scanner.
5
- Project-URL: Homepage, https://github.com/sai55387/deploy-guard
6
- Project-URL: Issues, https://github.com/sai55387/deploy-guard/issues
7
- Project-URL: Changelog, https://github.com/sai55387/deploy-guard/blob/main/CHANGELOG.md
8
- Author: sai55387
9
- License: MIT
10
- License-File: LICENSE
11
- Keywords: ci,control-flow,debugging,deployment,incident,nullability,root-cause,stacktrace,static-analysis,traceback
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Environment :: Console
14
- Classifier: Intended Audience :: Developers
15
- Classifier: License :: OSI Approved :: MIT License
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Programming Language :: Python :: 3.13
22
- Classifier: Topic :: Software Development :: Debuggers
23
- Classifier: Topic :: Software Development :: Quality Assurance
24
- Classifier: Topic :: Software Development :: Testing
25
- Requires-Python: >=3.10
26
- Provides-Extra: dev
27
- Requires-Dist: build; extra == 'dev'
28
- Requires-Dist: pytest-cov; extra == 'dev'
29
- Requires-Dist: pytest>=7.0; extra == 'dev'
30
- Requires-Dist: ruff; extra == 'dev'
31
- Requires-Dist: twine; extra == 'dev'
32
- Description-Content-Type: text/markdown
33
-
34
- # deploy-guard
35
-
36
- **Static root-cause analysis for a Python stack trace.** Paste a traceback,
37
- point it at the repo, and get: which variable is `None` and *why*, the branch
38
- path that reached the crash, where the bad value entered across the call
39
- chain, and a concrete fix. Fully local — no server, no account, no
40
- network. Zero dependencies. Python 3.10+.
41
-
42
- It also ships a deployment-gate scanner (`scan` / `check`), but for
43
- general-purpose linting you should run **[ruff](https://docs.astral.sh/ruff/)
44
- + [mypy](https://mypy-lang.org/)** — they are faster and deeper. What
45
- deploy-guard does that they don't is turn *a traceback you already have* into
46
- an explanation grounded in your code.
47
-
48
- ## Install
49
-
50
- ```bash
51
- pip install deploy-guard-engine # or: pipx install deploy-guard-engine
52
- ```
53
-
54
- Or run it with no install at all — a single ~120 KB file:
55
-
56
- ```bash
57
- ./scripts/build-standalone.sh # -> dist/deploy-guard.pyz
58
- python deploy-guard.pyz explain --project ./service < traceback.txt
59
- ```
60
-
61
- ## Explain a traceback
62
-
63
- ```bash
64
- deploy-guard explain --project ./service --file traceback.txt
65
- # or pipe it
66
- deploy-guard explain --project ./service < traceback.txt
67
- ```
68
-
69
- ```
70
- Explaining: AttributeError: 'NoneType' object has no attribute 'empty'
71
-
72
- Crash site: project_folder/file_name.py:231 — create_json
73
-
74
- 231 | if _df.empty or _df is None:
75
-
76
- Why:
77
-
78
- _df can be None because the default value passed to .get() is None.
79
-
80
- It reaches this line when processing report_dict.
81
-
82
- Although the condition checks _df is None, Python evaluates the or expression from left to right.
83
-
84
- Therefore, _df.empty is evaluated first. If _df is None, this raises an AttributeError before the None check is reached.
85
-
86
- Call chain (from the traceback):
87
-
88
- project_file:164 function_name
89
- └─ file_locator.py:231 create_json <- exception raised
90
-
91
- Scan finding:
92
- none-dereference (block) at file_locator.py:231
93
-
94
- Fix:
95
- Reorder the condition so _df is None is checked first:
96
-
97
- if _df is None or _df.empty:
98
-
99
- This ensures _df.empty is only accessed when _df is not None.
100
- ```
101
-
102
- Dedicated explanations for `AttributeError` / `TypeError` (None), `KeyError`,
103
- `IndexError`, `ZeroDivisionError`, `UnboundLocalError`, `NameError`, and
104
- `int()` / `float()` `ValueError`. Anything else falls back to the call chain
105
- + the branch conditions that reach the line. The call chain is analysed
106
- *interprocedurally* &mdash; each project frame is checked, and a `None` that
107
- originates in an argument is traced back to the caller that passed it.
108
-
109
- ## Scan a project
110
-
111
- ```bash
112
- deploy-guard scan ./service # report, never fails
113
- deploy-guard scan ./service --behavior # + the when-X-returns-Y table
114
- deploy-guard check ./service --fail-on review # gate: exit 1 on findings
115
- deploy-guard scan ./service --report report.json
116
- ```
117
-
118
- | Rule | Severity | Catches |
119
- |---|---|---|
120
- | `none-dereference` | block / review | attr/subscript on a possibly-`None` value (interprocedural: a call to a project function that can return `None` counts) |
121
- | `inconsistent-return` | review / note | returns a value on some paths, `None` on others &mdash; **review only when an in-project caller uses the result without a guard**, otherwise a note |
122
- | `swallowed-exception` | review | `except …: pass` |
123
- | `unreachable-code` | warn | code after an always-diverting branch |
124
- | `bare-except` | warn | `except:` with no type |
125
- | `mutable-default-arg` | warn | `def f(x=[])` |
126
- | `invalid-escape` | note | `"\d"` in a non-raw string |
127
- | `path-explosion` | note | too-branchy function (detection still complete) |
128
-
129
- Notes are collapsed to a one-line count; `--notes` lists them. Identical
130
- findings from copy-pasted functions fold into one; `--no-collapse` expands.
131
-
132
- ## Configuration
133
-
134
- A `[tool.deploy-guard]` table in the **scanned project's** `pyproject.toml`
135
- (Python 3.11+ for TOML reading):
136
-
137
- ```toml
138
- [tool.deploy-guard]
139
- disable = ["bare-except"]
140
- exclude = ["vendor", "migrations"]
141
- fail-on = "review"
142
- include-tests = false
143
- ```
144
-
145
- CLI flags override the file.
146
-
147
- ## How it works
148
-
149
- ```
150
- discover -> lower to IR -> CFG per function -> call graph
151
- -> behavior spec (path conditions -> returns/raises)
152
- -> nullability data-flow (merges None facts at every branch join; interprocedural)
153
- -> findings | explain (traceback -> the above, focused on one failure)
154
- ```
155
-
156
- The nullability pass is a forward fixpoint over the CFG &mdash; it merges
157
- facts at branch joins, so it covers 100% of a function regardless of how
158
- branchy it is, in roughly linear time.
159
-
160
- `scan` and `explain` only **read** your code &mdash; never import or run it.
161
-
162
- ## Develop
163
-
164
- ```bash
165
- pip install -e ".[dev]"
166
- pytest
167
- ruff check src
168
- ```
169
-
170
- ## What changed from the prototype
171
-
172
- See [CHANGELOG.md](CHANGELOG.md). Headline: an interprocedural call graph, so
173
- `explain` traces a `None` across frames and `inconsistent-return` no longer
174
- fires on copy-pasted helpers whose callers all guard the result; plus real
175
- packaging and a config file.