genesis-gates 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.
Files changed (74) hide show
  1. genesis_gates-0.1.0/.gitignore +16 -0
  2. genesis_gates-0.1.0/LICENSE +202 -0
  3. genesis_gates-0.1.0/PKG-INFO +92 -0
  4. genesis_gates-0.1.0/README.md +66 -0
  5. genesis_gates-0.1.0/contracts/domain/canonical-objects.schema.json +108 -0
  6. genesis_gates-0.1.0/contracts/evidence.schema.json +54 -0
  7. genesis_gates-0.1.0/contracts/gateconfig.schema.json +53 -0
  8. genesis_gates-0.1.0/contracts/manifest.schema.json +86 -0
  9. genesis_gates-0.1.0/contracts/readiness-report.schema.json +158 -0
  10. genesis_gates-0.1.0/contracts/task.schema.json +131 -0
  11. genesis_gates-0.1.0/examples/sample-repo/tests/test_app.py +15 -0
  12. genesis_gates-0.1.0/pyproject.toml +56 -0
  13. genesis_gates-0.1.0/src/genesis_gates/__init__.py +51 -0
  14. genesis_gates-0.1.0/src/genesis_gates/_plugins.py +183 -0
  15. genesis_gates-0.1.0/src/genesis_gates/analysis/__init__.py +44 -0
  16. genesis_gates-0.1.0/src/genesis_gates/analysis/completeness.py +341 -0
  17. genesis_gates-0.1.0/src/genesis_gates/analysis/dependency_reconcile.py +118 -0
  18. genesis_gates-0.1.0/src/genesis_gates/analysis/readiness.py +134 -0
  19. genesis_gates-0.1.0/src/genesis_gates/analysis/repo_scan.py +195 -0
  20. genesis_gates-0.1.0/src/genesis_gates/analysis/risk.py +93 -0
  21. genesis_gates-0.1.0/src/genesis_gates/config.py +52 -0
  22. genesis_gates-0.1.0/src/genesis_gates/contracts.py +64 -0
  23. genesis_gates-0.1.0/src/genesis_gates/engine/__init__.py +19 -0
  24. genesis_gates-0.1.0/src/genesis_gates/engine/base.py +181 -0
  25. genesis_gates-0.1.0/src/genesis_gates/engine/provider.py +57 -0
  26. genesis_gates-0.1.0/src/genesis_gates/engine/registry.py +24 -0
  27. genesis_gates-0.1.0/src/genesis_gates/engine/runner.py +94 -0
  28. genesis_gates-0.1.0/src/genesis_gates/gates/__init__.py +29 -0
  29. genesis_gates-0.1.0/src/genesis_gates/gates/_util.py +10 -0
  30. genesis_gates-0.1.0/src/genesis_gates/gates/container_scan.py +17 -0
  31. genesis_gates-0.1.0/src/genesis_gates/gates/dependency_scan.py +18 -0
  32. genesis_gates-0.1.0/src/genesis_gates/gates/iac_policy_check.py +18 -0
  33. genesis_gates-0.1.0/src/genesis_gates/gates/risk_classify.py +17 -0
  34. genesis_gates-0.1.0/src/genesis_gates/gates/sast.py +17 -0
  35. genesis_gates-0.1.0/src/genesis_gates/gates/sbom.py +16 -0
  36. genesis_gates-0.1.0/src/genesis_gates/gates/secret_scan.py +17 -0
  37. genesis_gates-0.1.0/src/genesis_gates/gates/unit_tests.py +111 -0
  38. genesis_gates-0.1.0/src/genesis_gates/parsers/__init__.py +30 -0
  39. genesis_gates-0.1.0/src/genesis_gates/parsers/cyclonedx.py +34 -0
  40. genesis_gates-0.1.0/src/genesis_gates/parsers/junit.py +44 -0
  41. genesis_gates-0.1.0/src/genesis_gates/parsers/sarif.py +59 -0
  42. genesis_gates-0.1.0/src/genesis_gates/providers/__init__.py +26 -0
  43. genesis_gates-0.1.0/src/genesis_gates/providers/_test_runner.py +188 -0
  44. genesis_gates-0.1.0/src/genesis_gates/providers/cargo_test.py +85 -0
  45. genesis_gates-0.1.0/src/genesis_gates/providers/command.py +119 -0
  46. genesis_gates-0.1.0/src/genesis_gates/providers/conftest.py +127 -0
  47. genesis_gates-0.1.0/src/genesis_gates/providers/external.py +52 -0
  48. genesis_gates-0.1.0/src/genesis_gates/providers/gitleaks.py +119 -0
  49. genesis_gates-0.1.0/src/genesis_gates/providers/go_test.py +100 -0
  50. genesis_gates-0.1.0/src/genesis_gates/providers/node_test.py +197 -0
  51. genesis_gates-0.1.0/src/genesis_gates/providers/pip_audit.py +106 -0
  52. genesis_gates-0.1.0/src/genesis_gates/providers/pytest_provider.py +216 -0
  53. genesis_gates-0.1.0/src/genesis_gates/providers/report.py +101 -0
  54. genesis_gates-0.1.0/src/genesis_gates/providers/risk_llm.py +121 -0
  55. genesis_gates-0.1.0/src/genesis_gates/providers/risk_rules.py +134 -0
  56. genesis_gates-0.1.0/src/genesis_gates/providers/semgrep.py +98 -0
  57. genesis_gates-0.1.0/src/genesis_gates/providers/syft.py +88 -0
  58. genesis_gates-0.1.0/src/genesis_gates/providers/trivy.py +114 -0
  59. genesis_gates-0.1.0/src/genesis_gates/providers/trivy_image.py +119 -0
  60. genesis_gates-0.1.0/src/genesis_gates/util.py +102 -0
  61. genesis_gates-0.1.0/tests/__init__.py +0 -0
  62. genesis_gates-0.1.0/tests/conftest.py +80 -0
  63. genesis_gates-0.1.0/tests/test_completeness_profiles.py +180 -0
  64. genesis_gates-0.1.0/tests/test_config.py +205 -0
  65. genesis_gates-0.1.0/tests/test_contracts.py +47 -0
  66. genesis_gates-0.1.0/tests/test_engine.py +109 -0
  67. genesis_gates-0.1.0/tests/test_extra_gates.py +42 -0
  68. genesis_gates-0.1.0/tests/test_gates.py +119 -0
  69. genesis_gates-0.1.0/tests/test_oss_boundary.py +38 -0
  70. genesis_gates-0.1.0/tests/test_plugins.py +286 -0
  71. genesis_gates-0.1.0/tests/test_providers.py +243 -0
  72. genesis_gates-0.1.0/tests/test_pytest_isolation.py +42 -0
  73. genesis_gates-0.1.0/tests/test_report_parsers.py +100 -0
  74. genesis_gates-0.1.0/tests/test_test_runners.py +763 -0
@@ -0,0 +1,16 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ *.egg-info/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ .mypy_cache/
9
+
10
+ # Genesis audit artifacts
11
+ .genesis-report/
12
+
13
+ # Environments / secrets
14
+ .env
15
+ .env.*
16
+ !.env.example
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: genesis-gates
3
+ Version: 0.1.0
4
+ Summary: Genesis delivery-governance gate engine: deterministic gates, system-completeness analysis, readiness scoring, and versioned JSON Schema contracts.
5
+ Project-URL: Homepage, https://github.com/Inceptium-ai/genesis-framework
6
+ Project-URL: Repository, https://github.com/Inceptium-ai/genesis-framework
7
+ Project-URL: Documentation, https://github.com/Inceptium-ai/genesis-framework/blob/main/docs/architecture.md
8
+ Project-URL: Issues, https://github.com/Inceptium-ai/genesis-framework/issues
9
+ Project-URL: Changelog, https://github.com/Inceptium-ai/genesis-framework/blob/main/CHANGELOG.md
10
+ Author-email: Inceptium <opensource@inceptium.ai>
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: ci,code-quality,devsecops,governance,sarif,static-analysis,supply-chain
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Classifier: Topic :: Software Development :: Testing
22
+ Requires-Python: >=3.12
23
+ Requires-Dist: jsonschema>=4.21
24
+ Requires-Dist: pyyaml>=6.0
25
+ Description-Content-Type: text/markdown
26
+
27
+ # genesis-gates — the Genesis gate engine
28
+
29
+ The deterministic engine behind [`genesis-cli`](https://pypi.org/project/genesis-cli/):
30
+ delivery gates, system-completeness analysis, readiness scoring, risk
31
+ classification, and the versioned JSON Schema contracts that make Genesis
32
+ artifacts portable between tools.
33
+
34
+ No API keys, no server, no network calls of its own — gates shell out to
35
+ scanners you already have and **skip cleanly** when one isn't installed.
36
+
37
+ ```bash
38
+ pip install genesis-gates
39
+ ```
40
+
41
+ Most people want the CLI instead: `pip install genesis-cli`.
42
+
43
+ ## What's in it
44
+
45
+ **Gate engine** (`genesis_gates.engine`) — a `Gate`/`Provider` registry, a
46
+ `GateRunner` that turns a Delivery Manifest plus a repo into a linked
47
+ `EvidencePackage`, and the `Finding`/`Severity`/`GateStatus` vocabulary every
48
+ gate reports in.
49
+
50
+ **Gates** (`genesis_gates.gates`) — secret-scan, dependency-scan, unit-tests
51
+ (run in an isolated venv built from the app's own requirements), SAST, SBOM.
52
+
53
+ **Analysis** (`genesis_gates.analysis`) — the layer that catches what scanners
54
+ can't:
55
+
56
+ - **System completeness profiles** — detects the systems a repo implements
57
+ (auth, payments, file upload) and checks their *mandatory flows* against the
58
+ implementation surface (routes, files), not prose. This is what catches an
59
+ app that ships signup with no sign-in, Stripe checkout with no webhook
60
+ signature verification, or uploads with no size limit.
61
+ - **Env reconciliation** — the compose `${VAR}` contract and direct env reads,
62
+ diffed for unset and undocumented variables.
63
+ - **Readiness scoring** — a 0–100 score with a grade, plus SARIF 2.1.0 output.
64
+ - **Risk classification** — deterministic: auth, payments, migrations,
65
+ secrets, and infra changes are always high-risk. This is the substrate for
66
+ bounded-autonomy policies ("low-risk changes flow, risky changes wait").
67
+
68
+ **Contracts** (`genesis_gates/contracts/*.schema.json`) — delivery manifests,
69
+ evidence packages, tasks, gate config, and readiness reports as JSON Schema
70
+ (Draft 2020-12), so any tool can produce or consume Genesis artifacts. The
71
+ schemas ship inside the wheel; `genesis_gates.contracts.contracts_dir()`
72
+ resolves them, and `GENESIS_CONTRACTS_DIR` overrides the location.
73
+
74
+ ## Using it directly
75
+
76
+ ```python
77
+ from genesis_gates import GateRunner, load_gate_config
78
+
79
+ runner = GateRunner(config=load_gate_config("."))
80
+ package = runner.run(repo=".")
81
+ for result in package.results:
82
+ print(result.gate, result.status, len(result.findings))
83
+ ```
84
+
85
+ Importing `genesis_gates.gates` and `genesis_gates.providers` populates the
86
+ registries via decorator side-effects — which is also how you extend Genesis:
87
+ `@register_gate` / `@register_provider` in your own module.
88
+
89
+ ## License
90
+
91
+ Apache-2.0. Part of the
92
+ [Genesis Framework](https://github.com/Inceptium-ai/genesis-framework).
@@ -0,0 +1,66 @@
1
+ # genesis-gates — the Genesis gate engine
2
+
3
+ The deterministic engine behind [`genesis-cli`](https://pypi.org/project/genesis-cli/):
4
+ delivery gates, system-completeness analysis, readiness scoring, risk
5
+ classification, and the versioned JSON Schema contracts that make Genesis
6
+ artifacts portable between tools.
7
+
8
+ No API keys, no server, no network calls of its own — gates shell out to
9
+ scanners you already have and **skip cleanly** when one isn't installed.
10
+
11
+ ```bash
12
+ pip install genesis-gates
13
+ ```
14
+
15
+ Most people want the CLI instead: `pip install genesis-cli`.
16
+
17
+ ## What's in it
18
+
19
+ **Gate engine** (`genesis_gates.engine`) — a `Gate`/`Provider` registry, a
20
+ `GateRunner` that turns a Delivery Manifest plus a repo into a linked
21
+ `EvidencePackage`, and the `Finding`/`Severity`/`GateStatus` vocabulary every
22
+ gate reports in.
23
+
24
+ **Gates** (`genesis_gates.gates`) — secret-scan, dependency-scan, unit-tests
25
+ (run in an isolated venv built from the app's own requirements), SAST, SBOM.
26
+
27
+ **Analysis** (`genesis_gates.analysis`) — the layer that catches what scanners
28
+ can't:
29
+
30
+ - **System completeness profiles** — detects the systems a repo implements
31
+ (auth, payments, file upload) and checks their *mandatory flows* against the
32
+ implementation surface (routes, files), not prose. This is what catches an
33
+ app that ships signup with no sign-in, Stripe checkout with no webhook
34
+ signature verification, or uploads with no size limit.
35
+ - **Env reconciliation** — the compose `${VAR}` contract and direct env reads,
36
+ diffed for unset and undocumented variables.
37
+ - **Readiness scoring** — a 0–100 score with a grade, plus SARIF 2.1.0 output.
38
+ - **Risk classification** — deterministic: auth, payments, migrations,
39
+ secrets, and infra changes are always high-risk. This is the substrate for
40
+ bounded-autonomy policies ("low-risk changes flow, risky changes wait").
41
+
42
+ **Contracts** (`genesis_gates/contracts/*.schema.json`) — delivery manifests,
43
+ evidence packages, tasks, gate config, and readiness reports as JSON Schema
44
+ (Draft 2020-12), so any tool can produce or consume Genesis artifacts. The
45
+ schemas ship inside the wheel; `genesis_gates.contracts.contracts_dir()`
46
+ resolves them, and `GENESIS_CONTRACTS_DIR` overrides the location.
47
+
48
+ ## Using it directly
49
+
50
+ ```python
51
+ from genesis_gates import GateRunner, load_gate_config
52
+
53
+ runner = GateRunner(config=load_gate_config("."))
54
+ package = runner.run(repo=".")
55
+ for result in package.results:
56
+ print(result.gate, result.status, len(result.findings))
57
+ ```
58
+
59
+ Importing `genesis_gates.gates` and `genesis_gates.providers` populates the
60
+ registries via decorator side-effects — which is also how you extend Genesis:
61
+ `@register_gate` / `@register_provider` in your own module.
62
+
63
+ ## License
64
+
65
+ Apache-2.0. Part of the
66
+ [Genesis Framework](https://github.com/Inceptium-ai/genesis-framework).
@@ -0,0 +1,108 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://genesis.dev/schemas/canonical-objects.schema.json",
4
+ "title": "Genesis Canonical Objects (graph v0)",
5
+ "description": "Vendor-neutral domain objects and relationships stored in the control-plane asset graph. The control-plane maps these to Postgres relationship tables (no graph DB in v0).",
6
+ "type": "object",
7
+ "$defs": {
8
+ "Owner": {
9
+ "type": "object",
10
+ "required": ["id", "name"],
11
+ "properties": {
12
+ "id": { "type": "string" },
13
+ "name": { "type": "string" },
14
+ "kind": { "enum": ["team", "person"], "default": "team" }
15
+ }
16
+ },
17
+ "Application": {
18
+ "type": "object",
19
+ "required": ["id", "name"],
20
+ "properties": { "id": { "type": "string" }, "name": { "type": "string" } }
21
+ },
22
+ "Service": {
23
+ "type": "object",
24
+ "required": ["id", "name"],
25
+ "properties": {
26
+ "id": { "type": "string" },
27
+ "name": { "type": "string" },
28
+ "owner_id": { "type": ["string", "null"] },
29
+ "criticality": { "enum": ["low", "medium", "high", "critical"] },
30
+ "data_classification": { "enum": ["public", "internal", "confidential", "restricted"] }
31
+ }
32
+ },
33
+ "Repository": {
34
+ "type": "object",
35
+ "required": ["id", "url"],
36
+ "properties": { "id": { "type": "string" }, "url": { "type": "string" }, "service_id": { "type": ["string", "null"] } }
37
+ },
38
+ "ChangeRequest": {
39
+ "type": "object",
40
+ "required": ["id", "title", "source"],
41
+ "properties": {
42
+ "id": { "type": "string", "description": "the manifest change.id, e.g. CHG-2026-00421" },
43
+ "title": { "type": "string" },
44
+ "source": { "enum": ["ai-assisted", "ai-generated", "human"] },
45
+ "service_id": { "type": ["string", "null"] },
46
+ "risk_level": { "enum": ["low", "medium", "high", "critical"] },
47
+ "manifest": { "type": "object" }
48
+ }
49
+ },
50
+ "ReleaseCandidate": {
51
+ "type": "object",
52
+ "required": ["id", "change_id", "status"],
53
+ "properties": {
54
+ "id": { "type": "string" },
55
+ "change_id": { "type": "string" },
56
+ "status": { "enum": ["passed", "failed", "error"] }
57
+ }
58
+ },
59
+ "EvidenceRecord": {
60
+ "type": "object",
61
+ "required": ["id", "change_id", "status", "created_at"],
62
+ "properties": {
63
+ "id": { "type": "string" },
64
+ "change_id": { "type": "string" },
65
+ "release_candidate_id": { "type": ["string", "null"] },
66
+ "status": { "enum": ["passed", "failed", "error"] },
67
+ "created_at": { "type": "string", "format": "date-time" },
68
+ "payload": { "type": "object", "description": "the full Evidence Package (evidence.schema.json)" }
69
+ }
70
+ },
71
+ "Finding": {
72
+ "type": "object",
73
+ "required": ["id", "gate", "title", "severity"],
74
+ "properties": {
75
+ "id": { "type": "string" },
76
+ "evidence_id": { "type": ["string", "null"] },
77
+ "gate": { "type": "string" },
78
+ "title": { "type": "string" },
79
+ "severity": { "enum": ["critical", "high", "medium", "low", "info"] },
80
+ "location": { "type": ["string", "null"] }
81
+ }
82
+ },
83
+ "PolicyDecision": {
84
+ "type": "object",
85
+ "required": ["id", "change_id", "decision"],
86
+ "properties": {
87
+ "id": { "type": "string" },
88
+ "change_id": { "type": "string" },
89
+ "decision": { "enum": ["allow", "deny", "allow-with-approval"] },
90
+ "rationale": { "type": "string" }
91
+ }
92
+ }
93
+ },
94
+ "relationships": {
95
+ "description": "Directed edges between the objects above (stored as rows: from_type, from_id, edge, to_type, to_id).",
96
+ "edges": [
97
+ "Owner OWNS Service",
98
+ "Application DEPENDS_ON Service",
99
+ "Service DEPENDS_ON Service",
100
+ "Repository BELONGS_TO Service",
101
+ "ChangeRequest TARGETS Service",
102
+ "ChangeRequest PRODUCES ReleaseCandidate",
103
+ "ReleaseCandidate VALIDATED_BY EvidenceRecord",
104
+ "EvidenceRecord HAS_FINDING Finding",
105
+ "ChangeRequest DECIDED_BY PolicyDecision"
106
+ ]
107
+ }
108
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://genesis.dev/schemas/evidence.schema.json",
4
+ "title": "Genesis Evidence Package",
5
+ "description": "The linked, exportable record produced when a Delivery Manifest is run through the gates. This is what the control plane ingests.",
6
+ "type": "object",
7
+ "required": ["apiVersion", "kind", "change_id", "status", "created_at", "gate_results"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "apiVersion": { "const": "genesis.dev/v0" },
11
+ "kind": { "const": "EvidencePackage" },
12
+ "change_id": { "type": "string" },
13
+ "service": { "type": ["string", "null"] },
14
+ "owner": { "type": ["string", "null"] },
15
+ "risk_level": { "type": ["string", "null"] },
16
+ "status": { "enum": ["passed", "failed", "error"], "description": "failed if any required gate failed; error if any gate errored and none failed" },
17
+ "created_at": { "type": "string", "format": "date-time" },
18
+ "manifest": { "type": "object" },
19
+ "gate_results": { "type": "array", "items": { "$ref": "#/$defs/gateResult" } },
20
+ "findings": {
21
+ "type": "array",
22
+ "description": "Flattened union of all gate findings, for convenient indexing.",
23
+ "items": { "$ref": "#/$defs/finding" }
24
+ }
25
+ },
26
+ "$defs": {
27
+ "gateResult": {
28
+ "type": "object",
29
+ "required": ["gate", "status"],
30
+ "additionalProperties": false,
31
+ "properties": {
32
+ "gate": { "type": "string" },
33
+ "status": { "enum": ["passed", "failed", "skipped", "error"] },
34
+ "summary": { "type": "string" },
35
+ "duration_s": { "type": "number" },
36
+ "error": { "type": ["string", "null"] },
37
+ "findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } }
38
+ }
39
+ },
40
+ "finding": {
41
+ "type": "object",
42
+ "required": ["gate", "title", "severity"],
43
+ "additionalProperties": false,
44
+ "properties": {
45
+ "gate": { "type": "string" },
46
+ "title": { "type": "string" },
47
+ "severity": { "enum": ["critical", "high", "medium", "low", "info"] },
48
+ "detail": { "type": "string" },
49
+ "location": { "type": ["string", "null"] },
50
+ "remediation": { "type": ["string", "null"] }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://genesis.dev/schemas/gateconfig.schema.json",
4
+ "title": "Genesis Gate Config",
5
+ "description": "Project-level `.genesis/config.yaml` — the 'how' (provider selection, thresholds, BYO tooling) that complements the sealed Delivery Manifest (the 'what'). All optional; absent file means every gate auto-picks its default provider.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "apiVersion": { "type": "string" },
10
+ "kind": { "const": "GateConfig" },
11
+ "defaults": { "$ref": "#/$defs/settings" },
12
+ "gates": {
13
+ "type": "object",
14
+ "description": "Per-gate overrides keyed by gate name (e.g. secret-scan, dependency-scan).",
15
+ "additionalProperties": { "$ref": "#/$defs/settings" }
16
+ }
17
+ },
18
+ "$defs": {
19
+ "settings": {
20
+ "type": "object",
21
+ "additionalProperties": true,
22
+ "properties": {
23
+ "provider": {
24
+ "type": "string",
25
+ "description": "Provider key: a built-in scanner (e.g. trivy, gitleaks, semgrep, syft, pip-audit, pytest, llm, rules) or a generic BYO provider (command | report | external)."
26
+ },
27
+ "fail_on_severity": {
28
+ "enum": ["critical", "high", "medium", "low", "info"],
29
+ "description": "Findings at or above this severity fail the gate (overrides the provider's default pass/fail)."
30
+ },
31
+ "timeout": { "type": "integer", "minimum": 1 },
32
+ "command": {
33
+ "type": ["string", "array"],
34
+ "items": { "type": "string" },
35
+ "description": "For provider: command — the tool to run."
36
+ },
37
+ "report": {
38
+ "type": "string",
39
+ "description": "For provider: report — path to a scan result your CI already produced."
40
+ },
41
+ "parser": {
42
+ "enum": ["sarif", "junit", "cyclonedx", "trivy-json", "gitleaks-json", "syft-json", "pip-audit-json"],
43
+ "description": "How to normalize command output / an imported report into findings."
44
+ },
45
+ "format": { "type": "string", "description": "Provider-specific output format (e.g. sbom cyclonedx-json)." },
46
+ "fail_on_nonzero": { "type": "boolean", "description": "For provider: command — treat a non-zero exit as a failing gate." },
47
+ "attested_by": { "type": "string", "description": "For provider: external — the system that handles this gate." },
48
+ "note": { "type": "string" },
49
+ "status": { "enum": ["passed", "skipped"], "description": "For provider: external — the recorded status (default passed, audit-noted)." }
50
+ }
51
+ }
52
+ }
53
+ }