suite-gate 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.
- suite_gate-0.1.0/LICENSE +202 -0
- suite_gate-0.1.0/MANIFEST.in +9 -0
- suite_gate-0.1.0/PKG-INFO +180 -0
- suite_gate-0.1.0/README.md +158 -0
- suite_gate-0.1.0/action.yml +58 -0
- suite_gate-0.1.0/docs/AGENTS.md +71 -0
- suite_gate-0.1.0/docs/action.md +82 -0
- suite_gate-0.1.0/docs/format.md +66 -0
- suite_gate-0.1.0/docs/gate.md +108 -0
- suite_gate-0.1.0/docs/mcp.md +85 -0
- suite_gate-0.1.0/docs/screenshots/README.md +22 -0
- suite_gate-0.1.0/docs/screenshots/git-overlap-audit-json.svg +35 -0
- suite_gate-0.1.0/docs/screenshots/git-overlap.svg +13 -0
- suite_gate-0.1.0/docs/screenshots/git-surface-audit-json.svg +35 -0
- suite_gate-0.1.0/docs/screenshots/git-surface.svg +16 -0
- suite_gate-0.1.0/docs/screenshots/glassbox-persist.svg +14 -0
- suite_gate-0.1.0/docs/screenshots/pr-merge-audit-report.png +0 -0
- suite_gate-0.1.0/docs/screenshots/release-drift-audit-json.svg +35 -0
- suite_gate-0.1.0/docs/screenshots/release-drift.svg +18 -0
- suite_gate-0.1.0/docs/screenshots/suite-gate-gate.svg +26 -0
- suite_gate-0.1.0/docs/screenshots/trust-path-audit-json.svg +36 -0
- suite_gate-0.1.0/docs/screenshots/trust-path.svg +15 -0
- suite_gate-0.1.0/docs/session.md +89 -0
- suite_gate-0.1.0/examples/invalid/bad-severity.json +33 -0
- suite_gate-0.1.0/examples/invalid/bad-target-kind.json +33 -0
- suite_gate-0.1.0/examples/invalid/empty-evidence.json +29 -0
- suite_gate-0.1.0/examples/invalid/exit-0-with-finding.json +33 -0
- suite_gate-0.1.0/examples/invalid/exit-1-info-only.json +33 -0
- suite_gate-0.1.0/examples/invalid/exit-1-with-error.json +37 -0
- suite_gate-0.1.0/examples/invalid/exit-3.json +33 -0
- suite_gate-0.1.0/examples/invalid/http-url.json +34 -0
- suite_gate-0.1.0/examples/invalid/line-without-path.json +31 -0
- suite_gate-0.1.0/examples/invalid/missing-record.json +27 -0
- suite_gate-0.1.0/examples/invalid/short-commit.json +33 -0
- suite_gate-0.1.0/examples/invalid/unknown-key.json +34 -0
- suite_gate-0.1.0/examples/invalid/wrong-format.json +33 -0
- suite_gate-0.1.0/examples/valid/clean.json +15 -0
- suite_gate-0.1.0/examples/valid/git-surface-finding.json +33 -0
- suite_gate-0.1.0/examples/valid/glassbox-persist.json +28 -0
- suite_gate-0.1.0/examples/valid/release-drift-info-only.json +29 -0
- suite_gate-0.1.0/examples/valid/trust-path-finding-and-error.json +38 -0
- suite_gate-0.1.0/pyproject.toml +38 -0
- suite_gate-0.1.0/requirements-test.txt +3 -0
- suite_gate-0.1.0/requirements-tools.txt +4 -0
- suite_gate-0.1.0/schema/audit-result-1.schema.json +71 -0
- suite_gate-0.1.0/scripts/screenshots.py +373 -0
- suite_gate-0.1.0/setup.cfg +4 -0
- suite_gate-0.1.0/suite_gate/__init__.py +4 -0
- suite_gate-0.1.0/suite_gate/__main__.py +6 -0
- suite_gate-0.1.0/suite_gate/action.py +148 -0
- suite_gate-0.1.0/suite_gate/cli.py +93 -0
- suite_gate-0.1.0/suite_gate/envelope.py +123 -0
- suite_gate-0.1.0/suite_gate/gate.py +301 -0
- suite_gate-0.1.0/suite_gate/mcp.py +427 -0
- suite_gate-0.1.0/suite_gate/rules/ci.json +13 -0
- suite_gate-0.1.0/suite_gate/rules/default.json +13 -0
- suite_gate-0.1.0/suite_gate/session.py +122 -0
- suite_gate-0.1.0/suite_gate.egg-info/PKG-INFO +180 -0
- suite_gate-0.1.0/suite_gate.egg-info/SOURCES.txt +71 -0
- suite_gate-0.1.0/suite_gate.egg-info/dependency_links.txt +1 -0
- suite_gate-0.1.0/suite_gate.egg-info/entry_points.txt +2 -0
- suite_gate-0.1.0/suite_gate.egg-info/top_level.txt +1 -0
- suite_gate-0.1.0/tests/__init__.py +0 -0
- suite_gate-0.1.0/tests/fixtures/mcp/requests.jsonl +20 -0
- suite_gate-0.1.0/tests/fixtures/mcp/responses.jsonl +19 -0
- suite_gate-0.1.0/tests/session_fixture.py +139 -0
- suite_gate-0.1.0/tests/test_action.py +199 -0
- suite_gate-0.1.0/tests/test_cli.py +55 -0
- suite_gate-0.1.0/tests/test_envelope.py +132 -0
- suite_gate-0.1.0/tests/test_gate.py +225 -0
- suite_gate-0.1.0/tests/test_mcp.py +220 -0
- suite_gate-0.1.0/tests/test_screenshots.py +108 -0
- suite_gate-0.1.0/tests/test_session.py +142 -0
suite_gate-0.1.0/LICENSE
ADDED
|
@@ -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,9 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# The tests and the docs, examples and fixtures they read ship in the sdist, so the suite runs from it.
|
|
3
|
+
include requirements-test.txt requirements-tools.txt action.yml
|
|
4
|
+
graft tests
|
|
5
|
+
graft docs
|
|
6
|
+
graft examples
|
|
7
|
+
graft schema
|
|
8
|
+
graft scripts
|
|
9
|
+
global-exclude __pycache__ *.py[cod]
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: suite-gate
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: One result format for six audit tools, a gate that gives one verdict per branch, and an MCP server that runs them.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/jacob-adm/suite-gate
|
|
7
|
+
Project-URL: Documentation, https://github.com/jacob-adm/suite-gate/tree/main/docs
|
|
8
|
+
Project-URL: Source, https://github.com/jacob-adm/suite-gate
|
|
9
|
+
Project-URL: Issues, https://github.com/jacob-adm/suite-gate/issues
|
|
10
|
+
Keywords: audit,code-review,pull-request,mcp,supply-chain,security,cli
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Topic :: Security
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# suite-gate
|
|
24
|
+
|
|
25
|
+
<!-- mcp-name: io.github.jacob-adm/suite-gate -->
|
|
26
|
+
|
|
27
|
+
suite-gate connects six command-line audit tools: git-surface, trust-path, release-drift,
|
|
28
|
+
git-overlap, pr-merge-audit and glassbox. It has three parts:
|
|
29
|
+
|
|
30
|
+
- **One result format.** Each tool, run with `--audit-json`, prints the same JSON object: every
|
|
31
|
+
finding with a rule id, a severity, one sentence and the evidence to check it (file, line, ref,
|
|
32
|
+
commit).
|
|
33
|
+
- **A gate.** `suite-gate gate BASE REF` runs the tools that apply to what a branch changes and
|
|
34
|
+
gives one verdict, `pass`, `warn`, `fail` or `error`, from a versioned rules file.
|
|
35
|
+
- **An MCP server.** `suite-gate mcp` lets a coding agent run the installed tools and read their
|
|
36
|
+
results, so it can check its own branch before asking for review.
|
|
37
|
+
|
|
38
|
+
Branches written by coding agents arrive faster than a person can read them. The checks that
|
|
39
|
+
matter (does it change CI, an install script, a dependency, a workflow's trust boundary, another
|
|
40
|
+
branch's files?) are spread over six tools with six output formats. suite-gate makes them one
|
|
41
|
+
check with one answer, and keeps every finding that led to it.
|
|
42
|
+
|
|
43
|
+
It decides nothing on its own. The verdict follows fixed rules in a file you can read and
|
|
44
|
+
version, no model takes part, and each finding is the tool's own, unchanged.
|
|
45
|
+
|
|
46
|
+
## Example output
|
|
47
|
+
|
|
48
|
+
The gate on a demo branch that adds a pull-request workflow, an agent instruction file and an
|
|
49
|
+
npm install script, and edits a file another branch also edits:
|
|
50
|
+
|
|
51
|
+
<p align="center"><img src="https://raw.githubusercontent.com/jacob-adm/suite-gate/main/docs/screenshots/suite-gate-gate.svg" alt="suite-gate gate failing a branch with findings from git-surface, trust-path and git-overlap"></p>
|
|
52
|
+
|
|
53
|
+
One tool's result in the shared format (`git surface --audit-json`, first lines):
|
|
54
|
+
|
|
55
|
+
<p align="center"><img src="https://raw.githubusercontent.com/jacob-adm/suite-gate/main/docs/screenshots/git-surface-audit-json.svg" alt="git surface --audit-json on a demo branch"></p>
|
|
56
|
+
|
|
57
|
+
## Requirements
|
|
58
|
+
|
|
59
|
+
- Python 3.9 or later, standard library only.
|
|
60
|
+
- git 2.38 or later, as an executable named `git` on `PATH`, for the gate.
|
|
61
|
+
- The audit tools to run, at a version that has `--audit-json`:
|
|
62
|
+
|
|
63
|
+
| Tool | Minimum | Install |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| git-surface | 0.4.0 | `pip install git-surface` |
|
|
66
|
+
| trust-path | 0.8.1 | `pip install trust-path` |
|
|
67
|
+
| release-drift | 0.7.0 | `pip install release-drift` |
|
|
68
|
+
| git-overlap | 0.7.0 | `pip install git-overlap` |
|
|
69
|
+
| pr-merge-audit | 2.3.0 | `pip install pr-merge-audit` |
|
|
70
|
+
| glassbox | 0.6.0 | `brew install jacob-adm/tap/glassbox`, or a [release](https://github.com/jacob-adm/glassbox/releases) |
|
|
71
|
+
|
|
72
|
+
The gate uses the first four. The MCP server offers each tool that is installed.
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
From PyPI:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
pip install suite-gate
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
From a clone:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
git clone https://github.com/jacob-adm/suite-gate
|
|
86
|
+
cd suite-gate
|
|
87
|
+
pip install .
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Either way pip installs `suite-gate` as a console script. Check the install:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
suite-gate --version
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
suite-gate 0.1.0
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Without installing, it also runs from a clone as `python3 -m suite_gate`.
|
|
101
|
+
|
|
102
|
+
## How it works
|
|
103
|
+
|
|
104
|
+
1. **Find what the branch changes.** The gate takes the merge base of BASE and REF and lists the
|
|
105
|
+
paths REF changes since then, as a pull request's "files changed" does.
|
|
106
|
+
2. **Pick the checks.** The rules file names each check and when it runs: git-surface always,
|
|
107
|
+
trust-path when a workflow changed, release-drift for each changed lockfile, git-overlap
|
|
108
|
+
against the other branches. A check that does not apply is listed as skipped, with the reason.
|
|
109
|
+
3. **Run each tool with `--audit-json`.** Every result is checked against the format before it is
|
|
110
|
+
used: a tool that is missing, too old, or prints an invalid object is an error, never a pass.
|
|
111
|
+
4. **Decide.** `fail` if a finding has a severity the rules fail on (`high` by default); else
|
|
112
|
+
`error` if a check could not run; else `warn` if a finding has a warn severity (`medium`,
|
|
113
|
+
`low`); else `pass`. The exit status is 1 for `fail`, 2 for `error` and 0 otherwise.
|
|
114
|
+
5. **Report.** One line per check, then each finding with its path and line. With `--json`, one
|
|
115
|
+
object with the rules' name, version and SHA-256, the commits, and every tool's result,
|
|
116
|
+
unchanged.
|
|
117
|
+
|
|
118
|
+
## Commands
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
suite-gate gate [--repo DIR] [--rules FILE] [--json] BASE REF one verdict for REF against BASE
|
|
122
|
+
suite-gate mcp [--timeout SECONDS] serve the audit tools to an MCP client
|
|
123
|
+
suite-gate session save|check|run [--repo DIR]... [-- COMMAND] what an agent session left that runs later
|
|
124
|
+
suite-gate validate [FILE] check an audit result object
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
See [Gate](https://github.com/jacob-adm/suite-gate/blob/main/docs/gate.md) for every option, the
|
|
128
|
+
rules file and the JSON result, and [MCP server](https://github.com/jacob-adm/suite-gate/blob/main/docs/mcp.md)
|
|
129
|
+
for the tools an agent gets.
|
|
130
|
+
|
|
131
|
+
## Quick start
|
|
132
|
+
|
|
133
|
+
Install the tools the gate runs, then run it inside the repository on the branch to check.
|
|
134
|
+
Replace `main` with the base branch:
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
pip install git-surface trust-path release-drift git-overlap
|
|
138
|
+
suite-gate gate main ci
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
For a branch named `ci` whose only change is to a CI workflow:
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
FAIL: ci into main (rules default 1)
|
|
145
|
+
git-surface ran 1 high (always runs)
|
|
146
|
+
trust-path ran nothing found (changed: .github/workflows/ci.yml)
|
|
147
|
+
release-drift skipped no changed lockfile
|
|
148
|
+
git-overlap ran nothing found (against 5 other branch(es) under refs/heads/)
|
|
149
|
+
high git-surface.ci ci modifies CI file .github/workflows/ci.yml [.github/workflows/ci.yml]
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
git-surface reports the workflow change as `high`, so the verdict is `fail` and the exit status
|
|
153
|
+
is 1. trust-path ran because a workflow changed and found no path from untrusted input. No
|
|
154
|
+
lockfile changed, so release-drift was skipped.
|
|
155
|
+
|
|
156
|
+
To run the gate on every pull request, use the [GitHub Action](https://github.com/jacob-adm/suite-gate/blob/main/docs/action.md).
|
|
157
|
+
To give a coding agent the tools, register the MCP server. For Claude Code:
|
|
158
|
+
|
|
159
|
+
```sh
|
|
160
|
+
claude mcp add suite-gate -- suite-gate mcp
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Documentation
|
|
164
|
+
|
|
165
|
+
- [For coding agents](https://github.com/jacob-adm/suite-gate/blob/main/docs/AGENTS.md): how an agent runs suite-gate, reads `--audit-json` and cites the evidence.
|
|
166
|
+
- [Gate](https://github.com/jacob-adm/suite-gate/blob/main/docs/gate.md): the command, the rules file, the verdict and the JSON result.
|
|
167
|
+
- [MCP server](https://github.com/jacob-adm/suite-gate/blob/main/docs/mcp.md): setting it up, the tools, and how results and errors are returned.
|
|
168
|
+
- [GitHub Action](https://github.com/jacob-adm/suite-gate/blob/main/docs/action.md): the gate on every pull request, with findings annotated on their lines.
|
|
169
|
+
- [Session check](https://github.com/jacob-adm/suite-gate/blob/main/docs/session.md): a glassbox snapshot before an agent session and a report after it, by hand, around one command, or as Claude Code hooks.
|
|
170
|
+
- [Result format](https://github.com/jacob-adm/suite-gate/blob/main/docs/format.md): the object each tool prints with `--audit-json`, its exit status rules, and the
|
|
171
|
+
[JSON Schema](https://github.com/jacob-adm/suite-gate/blob/main/schema/audit-result-1.schema.json) with
|
|
172
|
+
[examples](https://github.com/jacob-adm/suite-gate/tree/main/examples) that pass and fail.
|
|
173
|
+
- [Screenshots](https://github.com/jacob-adm/suite-gate/tree/main/docs/screenshots): each tool's real output on a demo repository, with and without
|
|
174
|
+
`--audit-json`.
|
|
175
|
+
- [Contributing](https://github.com/jacob-adm/suite-gate/blob/main/CONTRIBUTING.md): running the tests and contributing a change.
|
|
176
|
+
- [Reporting a vulnerability](https://github.com/jacob-adm/suite-gate/blob/main/SECURITY.md)
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
Apache License 2.0; see [LICENSE](https://github.com/jacob-adm/suite-gate/blob/main/LICENSE).
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# suite-gate
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.jacob-adm/suite-gate -->
|
|
4
|
+
|
|
5
|
+
suite-gate connects six command-line audit tools: git-surface, trust-path, release-drift,
|
|
6
|
+
git-overlap, pr-merge-audit and glassbox. It has three parts:
|
|
7
|
+
|
|
8
|
+
- **One result format.** Each tool, run with `--audit-json`, prints the same JSON object: every
|
|
9
|
+
finding with a rule id, a severity, one sentence and the evidence to check it (file, line, ref,
|
|
10
|
+
commit).
|
|
11
|
+
- **A gate.** `suite-gate gate BASE REF` runs the tools that apply to what a branch changes and
|
|
12
|
+
gives one verdict, `pass`, `warn`, `fail` or `error`, from a versioned rules file.
|
|
13
|
+
- **An MCP server.** `suite-gate mcp` lets a coding agent run the installed tools and read their
|
|
14
|
+
results, so it can check its own branch before asking for review.
|
|
15
|
+
|
|
16
|
+
Branches written by coding agents arrive faster than a person can read them. The checks that
|
|
17
|
+
matter (does it change CI, an install script, a dependency, a workflow's trust boundary, another
|
|
18
|
+
branch's files?) are spread over six tools with six output formats. suite-gate makes them one
|
|
19
|
+
check with one answer, and keeps every finding that led to it.
|
|
20
|
+
|
|
21
|
+
It decides nothing on its own. The verdict follows fixed rules in a file you can read and
|
|
22
|
+
version, no model takes part, and each finding is the tool's own, unchanged.
|
|
23
|
+
|
|
24
|
+
## Example output
|
|
25
|
+
|
|
26
|
+
The gate on a demo branch that adds a pull-request workflow, an agent instruction file and an
|
|
27
|
+
npm install script, and edits a file another branch also edits:
|
|
28
|
+
|
|
29
|
+
<p align="center"><img src="https://raw.githubusercontent.com/jacob-adm/suite-gate/main/docs/screenshots/suite-gate-gate.svg" alt="suite-gate gate failing a branch with findings from git-surface, trust-path and git-overlap"></p>
|
|
30
|
+
|
|
31
|
+
One tool's result in the shared format (`git surface --audit-json`, first lines):
|
|
32
|
+
|
|
33
|
+
<p align="center"><img src="https://raw.githubusercontent.com/jacob-adm/suite-gate/main/docs/screenshots/git-surface-audit-json.svg" alt="git surface --audit-json on a demo branch"></p>
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
- Python 3.9 or later, standard library only.
|
|
38
|
+
- git 2.38 or later, as an executable named `git` on `PATH`, for the gate.
|
|
39
|
+
- The audit tools to run, at a version that has `--audit-json`:
|
|
40
|
+
|
|
41
|
+
| Tool | Minimum | Install |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| git-surface | 0.4.0 | `pip install git-surface` |
|
|
44
|
+
| trust-path | 0.8.1 | `pip install trust-path` |
|
|
45
|
+
| release-drift | 0.7.0 | `pip install release-drift` |
|
|
46
|
+
| git-overlap | 0.7.0 | `pip install git-overlap` |
|
|
47
|
+
| pr-merge-audit | 2.3.0 | `pip install pr-merge-audit` |
|
|
48
|
+
| glassbox | 0.6.0 | `brew install jacob-adm/tap/glassbox`, or a [release](https://github.com/jacob-adm/glassbox/releases) |
|
|
49
|
+
|
|
50
|
+
The gate uses the first four. The MCP server offers each tool that is installed.
|
|
51
|
+
|
|
52
|
+
## Install
|
|
53
|
+
|
|
54
|
+
From PyPI:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
pip install suite-gate
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
From a clone:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
git clone https://github.com/jacob-adm/suite-gate
|
|
64
|
+
cd suite-gate
|
|
65
|
+
pip install .
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Either way pip installs `suite-gate` as a console script. Check the install:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
suite-gate --version
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
suite-gate 0.1.0
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Without installing, it also runs from a clone as `python3 -m suite_gate`.
|
|
79
|
+
|
|
80
|
+
## How it works
|
|
81
|
+
|
|
82
|
+
1. **Find what the branch changes.** The gate takes the merge base of BASE and REF and lists the
|
|
83
|
+
paths REF changes since then, as a pull request's "files changed" does.
|
|
84
|
+
2. **Pick the checks.** The rules file names each check and when it runs: git-surface always,
|
|
85
|
+
trust-path when a workflow changed, release-drift for each changed lockfile, git-overlap
|
|
86
|
+
against the other branches. A check that does not apply is listed as skipped, with the reason.
|
|
87
|
+
3. **Run each tool with `--audit-json`.** Every result is checked against the format before it is
|
|
88
|
+
used: a tool that is missing, too old, or prints an invalid object is an error, never a pass.
|
|
89
|
+
4. **Decide.** `fail` if a finding has a severity the rules fail on (`high` by default); else
|
|
90
|
+
`error` if a check could not run; else `warn` if a finding has a warn severity (`medium`,
|
|
91
|
+
`low`); else `pass`. The exit status is 1 for `fail`, 2 for `error` and 0 otherwise.
|
|
92
|
+
5. **Report.** One line per check, then each finding with its path and line. With `--json`, one
|
|
93
|
+
object with the rules' name, version and SHA-256, the commits, and every tool's result,
|
|
94
|
+
unchanged.
|
|
95
|
+
|
|
96
|
+
## Commands
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
suite-gate gate [--repo DIR] [--rules FILE] [--json] BASE REF one verdict for REF against BASE
|
|
100
|
+
suite-gate mcp [--timeout SECONDS] serve the audit tools to an MCP client
|
|
101
|
+
suite-gate session save|check|run [--repo DIR]... [-- COMMAND] what an agent session left that runs later
|
|
102
|
+
suite-gate validate [FILE] check an audit result object
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
See [Gate](https://github.com/jacob-adm/suite-gate/blob/main/docs/gate.md) for every option, the
|
|
106
|
+
rules file and the JSON result, and [MCP server](https://github.com/jacob-adm/suite-gate/blob/main/docs/mcp.md)
|
|
107
|
+
for the tools an agent gets.
|
|
108
|
+
|
|
109
|
+
## Quick start
|
|
110
|
+
|
|
111
|
+
Install the tools the gate runs, then run it inside the repository on the branch to check.
|
|
112
|
+
Replace `main` with the base branch:
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
pip install git-surface trust-path release-drift git-overlap
|
|
116
|
+
suite-gate gate main ci
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
For a branch named `ci` whose only change is to a CI workflow:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
FAIL: ci into main (rules default 1)
|
|
123
|
+
git-surface ran 1 high (always runs)
|
|
124
|
+
trust-path ran nothing found (changed: .github/workflows/ci.yml)
|
|
125
|
+
release-drift skipped no changed lockfile
|
|
126
|
+
git-overlap ran nothing found (against 5 other branch(es) under refs/heads/)
|
|
127
|
+
high git-surface.ci ci modifies CI file .github/workflows/ci.yml [.github/workflows/ci.yml]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
git-surface reports the workflow change as `high`, so the verdict is `fail` and the exit status
|
|
131
|
+
is 1. trust-path ran because a workflow changed and found no path from untrusted input. No
|
|
132
|
+
lockfile changed, so release-drift was skipped.
|
|
133
|
+
|
|
134
|
+
To run the gate on every pull request, use the [GitHub Action](https://github.com/jacob-adm/suite-gate/blob/main/docs/action.md).
|
|
135
|
+
To give a coding agent the tools, register the MCP server. For Claude Code:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
claude mcp add suite-gate -- suite-gate mcp
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Documentation
|
|
142
|
+
|
|
143
|
+
- [For coding agents](https://github.com/jacob-adm/suite-gate/blob/main/docs/AGENTS.md): how an agent runs suite-gate, reads `--audit-json` and cites the evidence.
|
|
144
|
+
- [Gate](https://github.com/jacob-adm/suite-gate/blob/main/docs/gate.md): the command, the rules file, the verdict and the JSON result.
|
|
145
|
+
- [MCP server](https://github.com/jacob-adm/suite-gate/blob/main/docs/mcp.md): setting it up, the tools, and how results and errors are returned.
|
|
146
|
+
- [GitHub Action](https://github.com/jacob-adm/suite-gate/blob/main/docs/action.md): the gate on every pull request, with findings annotated on their lines.
|
|
147
|
+
- [Session check](https://github.com/jacob-adm/suite-gate/blob/main/docs/session.md): a glassbox snapshot before an agent session and a report after it, by hand, around one command, or as Claude Code hooks.
|
|
148
|
+
- [Result format](https://github.com/jacob-adm/suite-gate/blob/main/docs/format.md): the object each tool prints with `--audit-json`, its exit status rules, and the
|
|
149
|
+
[JSON Schema](https://github.com/jacob-adm/suite-gate/blob/main/schema/audit-result-1.schema.json) with
|
|
150
|
+
[examples](https://github.com/jacob-adm/suite-gate/tree/main/examples) that pass and fail.
|
|
151
|
+
- [Screenshots](https://github.com/jacob-adm/suite-gate/tree/main/docs/screenshots): each tool's real output on a demo repository, with and without
|
|
152
|
+
`--audit-json`.
|
|
153
|
+
- [Contributing](https://github.com/jacob-adm/suite-gate/blob/main/CONTRIBUTING.md): running the tests and contributing a change.
|
|
154
|
+
- [Reporting a vulnerability](https://github.com/jacob-adm/suite-gate/blob/main/SECURITY.md)
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
Apache License 2.0; see [LICENSE](https://github.com/jacob-adm/suite-gate/blob/main/LICENSE).
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
name: suite-gate
|
|
3
|
+
description: One verdict for a pull request from the audit tools, with each finding annotated on its file and line.
|
|
4
|
+
author: jacob-adm
|
|
5
|
+
branding:
|
|
6
|
+
icon: shield
|
|
7
|
+
color: blue
|
|
8
|
+
|
|
9
|
+
inputs:
|
|
10
|
+
base:
|
|
11
|
+
description: Commit or branch to compare with. Default, on a pull request, origin/ and the base branch.
|
|
12
|
+
required: false
|
|
13
|
+
default: ""
|
|
14
|
+
ref:
|
|
15
|
+
description: Commit or branch to judge.
|
|
16
|
+
required: false
|
|
17
|
+
default: HEAD
|
|
18
|
+
rules:
|
|
19
|
+
description: Rules file in the repository, or a built-in name (ci or default).
|
|
20
|
+
required: false
|
|
21
|
+
default: ci
|
|
22
|
+
lockfile-cache:
|
|
23
|
+
description: Directory release-drift reads packages from instead of the registries.
|
|
24
|
+
required: false
|
|
25
|
+
default: ""
|
|
26
|
+
python-version:
|
|
27
|
+
description: Python the tools run on.
|
|
28
|
+
required: false
|
|
29
|
+
default: "3.13"
|
|
30
|
+
|
|
31
|
+
outputs:
|
|
32
|
+
verdict:
|
|
33
|
+
description: pass, warn, fail or error.
|
|
34
|
+
value: ${{ steps.gate.outputs.verdict }}
|
|
35
|
+
result:
|
|
36
|
+
description: Path of the gate result object (gate-result/1, JSON).
|
|
37
|
+
value: ${{ steps.gate.outputs.result }}
|
|
38
|
+
|
|
39
|
+
runs:
|
|
40
|
+
using: composite
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
43
|
+
with:
|
|
44
|
+
python-version: ${{ inputs.python-version }}
|
|
45
|
+
- name: Install suite-gate and the audit tools
|
|
46
|
+
shell: bash
|
|
47
|
+
env:
|
|
48
|
+
ACTION_PATH: ${{ github.action_path }}
|
|
49
|
+
run: python -m pip install --disable-pip-version-check "$ACTION_PATH" -r "$ACTION_PATH/requirements-tools.txt"
|
|
50
|
+
- name: Gate
|
|
51
|
+
id: gate
|
|
52
|
+
shell: bash
|
|
53
|
+
env:
|
|
54
|
+
GATE_BASE: ${{ inputs.base }}
|
|
55
|
+
GATE_REF: ${{ inputs.ref }}
|
|
56
|
+
GATE_RULES: ${{ inputs.rules }}
|
|
57
|
+
GATE_LOCKFILE_CACHE: ${{ inputs.lockfile-cache }}
|
|
58
|
+
run: python -m suite_gate action
|