warrant-cli 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.
- warrant_cli-0.1.0/LICENSE +202 -0
- warrant_cli-0.1.0/PKG-INFO +189 -0
- warrant_cli-0.1.0/README.md +168 -0
- warrant_cli-0.1.0/pyproject.toml +35 -0
- warrant_cli-0.1.0/setup.cfg +4 -0
- warrant_cli-0.1.0/tests/test_example.py +58 -0
- warrant_cli-0.1.0/tests/test_flow.py +153 -0
- warrant_cli-0.1.0/tests/test_parts.py +188 -0
- warrant_cli-0.1.0/warrant/__init__.py +8 -0
- warrant_cli-0.1.0/warrant/__main__.py +3 -0
- warrant_cli-0.1.0/warrant/checks.py +120 -0
- warrant_cli-0.1.0/warrant/cli.py +321 -0
- warrant_cli-0.1.0/warrant/config.py +192 -0
- warrant_cli-0.1.0/warrant/errors.py +2 -0
- warrant_cli-0.1.0/warrant/gate.py +151 -0
- warrant_cli-0.1.0/warrant/hashing.py +85 -0
- warrant_cli-0.1.0/warrant/intent.py +104 -0
- warrant_cli-0.1.0/warrant/ledger.py +106 -0
- warrant_cli-0.1.0/warrant/project.py +81 -0
- warrant_cli-0.1.0/warrant/report.py +261 -0
- warrant_cli-0.1.0/warrant/scaffold.py +112 -0
- warrant_cli-0.1.0/warrant/verify.py +120 -0
- warrant_cli-0.1.0/warrant_cli.egg-info/PKG-INFO +189 -0
- warrant_cli-0.1.0/warrant_cli.egg-info/SOURCES.txt +25 -0
- warrant_cli-0.1.0/warrant_cli.egg-info/dependency_links.txt +1 -0
- warrant_cli-0.1.0/warrant_cli.egg-info/entry_points.txt +2 -0
- warrant_cli-0.1.0/warrant_cli.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: warrant-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Humans state intent. Agents write the code. Evidence decides what ships.
|
|
5
|
+
Author: mv2a
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/mv2a/warrant
|
|
8
|
+
Project-URL: Specification, https://github.com/mv2a/warrant/blob/main/SPEC.md
|
|
9
|
+
Project-URL: Issues, https://github.com/mv2a/warrant/issues
|
|
10
|
+
Keywords: ai-agents,coding-agents,verification,evidence,spec-driven-development
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Classifier: Topic :: Software Development :: Testing
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# Warrant
|
|
23
|
+
|
|
24
|
+
[](https://github.com/mv2a/warrant/actions/workflows/ci.yml)
|
|
25
|
+
|
|
26
|
+
**Humans state intent. Agents write the code. Evidence decides what ships.**
|
|
27
|
+
|
|
28
|
+
Warrant is an open protocol, with a reference command-line tool, for software that AI agents build and maintain while humans direct it without reading the code.
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
> **Status: v0.1, experimental.** The [specification](SPEC.md) is a draft and the tool is a reference implementation, not a hardened product. Critique is very welcome.
|
|
33
|
+
|
|
34
|
+
## The problem
|
|
35
|
+
|
|
36
|
+
Coding agents now write whole codebases. OpenAI built a product of about a million lines with no hand-written code. Sixteen Claude agents wrote a C compiler that builds Linux. StrongDM runs a team whose rules say humans neither write nor review code. ([Sources](PRIOR-ART.md#5-dark-factories-agents-running-the-lifecycle).)
|
|
37
|
+
|
|
38
|
+
Nobody can review that much code, and skipping review without replacing it has gone badly: agents game the tests they can see, ship insecure code, and delete production data. Across everything we surveyed, the projects that work without humans reading the code have one thing in common. They replaced code review with **independent evidence**: hidden test scenarios, machine-checked proofs, or comparison against a trusted reference.
|
|
39
|
+
|
|
40
|
+
Warrant turns that practice into an open protocol that works with any agent and any language.
|
|
41
|
+
|
|
42
|
+
## How it works
|
|
43
|
+
|
|
44
|
+
```mermaid
|
|
45
|
+
flowchart LR
|
|
46
|
+
P([Principal]) -- intent --> B{{Builder}}
|
|
47
|
+
P -- approved checks --> E{{Examiner}}
|
|
48
|
+
B -- code --> E
|
|
49
|
+
E -- evidence --> G{{Gatekeeper}}
|
|
50
|
+
G -- warrant or denial --> L[(Ledger)]
|
|
51
|
+
L -- report --> P
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
1. A **principal**, the person accountable for the outcome, writes the **intent**: promises in plain language, each with an ID.
|
|
55
|
+
2. An **examiner** drafts **checks** for those promises. Some are visible to the builder and the rest stay hidden. The principal approves them, and only approved checks count.
|
|
56
|
+
3. A **builder**, a coding agent, writes the code. It sees the intent and the visible checks, and nothing else.
|
|
57
|
+
4. The examiner runs every check against an exact snapshot of the code and records the **evidence**.
|
|
58
|
+
5. A deterministic **gatekeeper** applies the policy to the evidence and issues a **warrant**, or a denial, for each action, such as merge or release.
|
|
59
|
+
6. Everything goes into an append-only **ledger**. The principal reads which promises were kept and which were broken, not code.
|
|
60
|
+
7. When something goes wrong in production, the principal records an **incident**, and releases stop until it has become a check.
|
|
61
|
+
|
|
62
|
+
In argument theory, a *warrant* is the rule that lets evidence support a claim. Here it is also the permission that follows.
|
|
63
|
+
|
|
64
|
+
## Try it
|
|
65
|
+
|
|
66
|
+
You need Python 3.11 or newer, and nothing else.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git clone https://github.com/mv2a/warrant.git
|
|
70
|
+
cd warrant
|
|
71
|
+
examples/pricing/demo.sh
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The [example](examples/pricing) is a small shop's checkout pricing. Its [intent](examples/pricing/intent.md) makes nine promises, such as "orders over $100.00 get 10% off" and "invalid requests are refused, never priced". Two candidate implementations were written by coding agents. You don't need to read either.
|
|
75
|
+
|
|
76
|
+
Candidate A passes every check it can see. The builder is told only which promises the hidden checks found unmet:
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
$ warrant verify --workspace candidates/overfit --audience builder
|
|
80
|
+
Verified candidates/overfit (sha256:7bb39c5c3689) with 7 checks.
|
|
81
|
+
|
|
82
|
+
PASS P1 visible The quote command follows the published contract: valid requests get wh…
|
|
83
|
+
PASS P2 visible The three example orders in the intent are charged exactly what the int…
|
|
84
|
+
hidden checks: 3 passed, 2 did not
|
|
85
|
+
|
|
86
|
+
Promises the hidden checks found unmet:
|
|
87
|
+
C1 Money is counted in whole cents. A discount that works out to a fraction of a cent is rou…
|
|
88
|
+
C3 Invalid requests are refused, never priced. That includes a subtotal that is negative, fr…
|
|
89
|
+
Re-read those promises. The hidden checks won't say more.
|
|
90
|
+
|
|
91
|
+
$ warrant gate merge --workspace candidates/overfit
|
|
92
|
+
merge: DENIED for candidates/overfit (sha256:7bb39c5c3689)
|
|
93
|
+
- H2 failed
|
|
94
|
+
- H5 failed
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The principal's report explains the denial in terms of promises, not code:
|
|
98
|
+
|
|
99
|
+
| Clause | Promise | Checked by | Status |
|
|
100
|
+
|---|---|---|---|
|
|
101
|
+
| G1 | Orders with a subtotal over $100.00 get 10% off the subtotal. | H1 | ✅ Kept (tested) |
|
|
102
|
+
| G2 | Loyalty members never pay for shipping. Everyone else pays a flat $7.50. | H3 | ✅ Kept (tested) |
|
|
103
|
+
| C1 | Money is counted in whole cents. A discount that works out to a fraction of a cent is rounded down. | H2 | ❌ Broken |
|
|
104
|
+
| C3 | Invalid requests are refused, never priced. … | P1, H5 | ❌ Broken |
|
|
105
|
+
| … | *five more promises, all kept* | | |
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
subtotal 10015: expected a discount of 1001, got 1002
|
|
109
|
+
a fractional subtotal: expected a refusal (status 2, no output), got status 0 and {... 'total_cents': 870.5}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Candidate B earns warrants for both merge and release. Then a production incident is recorded, and releases stop until someone turns it into a check.
|
|
113
|
+
|
|
114
|
+
## The rules
|
|
115
|
+
|
|
116
|
+
1. **Humans own the definition of done.** Agents may draft checks, but only the principal's approval makes them binding. Any later change to the intent, the checks or the policy voids that approval.
|
|
117
|
+
2. **Builders never grade their own work.** Evidence comes from an examiner the builder can't influence.
|
|
118
|
+
3. **Hidden checks stay hidden.** Builders learn which promises failed, never how they were tested, so they have to satisfy the intent rather than the tests.
|
|
119
|
+
4. **Evidence is bound to exact content.** It names the precise snapshot of code and the precise version of the check. Change either one and the evidence no longer applies.
|
|
120
|
+
5. **No evidence, no warrant.** A missing result counts as a failure, and every promise needs a check.
|
|
121
|
+
6. **Gates are deterministic.** No model decides whether something ships.
|
|
122
|
+
7. **Everything is on the record.** The ledger is append-only and hash-chained.
|
|
123
|
+
|
|
124
|
+
## Use it
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
pip install git+https://github.com/mv2a/warrant.git
|
|
128
|
+
warrant init my-service
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
| Command | Run by | What it does |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| `warrant check` | anyone | Validates the intent, checks and policy, and shows coverage and approval |
|
|
134
|
+
| `warrant approve --by NAME` | principal | Approves the current intent, checks and policy |
|
|
135
|
+
| `warrant brief` | orchestrator | Prints the builder's brief, which never includes hidden checks |
|
|
136
|
+
| `warrant verify [--audience builder]` | examiner | Runs the checks on a snapshot of the workspace and records evidence |
|
|
137
|
+
| `warrant gate ACTION` | gatekeeper | Issues a warrant or a denial, and exits non-zero on denial so CI can use it |
|
|
138
|
+
| `warrant report` | principal | Shows promises kept and broken, failures, caveats and incidents |
|
|
139
|
+
| `warrant incident add ID "WHAT HAPPENED" --by NAME` | principal | Records a problem found in production |
|
|
140
|
+
| `warrant log [--verify]` | anyone | Shows the ledger, or checks that it is intact |
|
|
141
|
+
|
|
142
|
+
A check is any command: a test suite, a property-based test, a proof checker such as `lean` or `dafny verify`, a security scanner, or a benchmark. It passes when it exits with status 0. [SPEC.md](SPEC.md) defines the file formats, the evidence and the ledger.
|
|
143
|
+
|
|
144
|
+
## Why not a new programming language?
|
|
145
|
+
|
|
146
|
+
That's where this project started. Programming languages were designed for humans, so shouldn't AI get its own, maybe even raw binary? We [surveyed the field](PRIOR-ART.md) before writing any code:
|
|
147
|
+
|
|
148
|
+
- At least a dozen languages built for AI have launched since 2025, most notably Vercel Labs' Zero. None has shown an advantage on real projects, and models remain far stronger in the languages they have the most training data for.
|
|
149
|
+
- Generating binary directly does worst of all: output is longer, accuracy is lower, and nothing is left that can be verified.
|
|
150
|
+
- In every case we found, what made agent-written code trustworthy was the evidence, not the language.
|
|
151
|
+
|
|
152
|
+
So Warrant doesn't care what builders write. The language that matters is the one humans and agents use to agree on what "done" means. That also makes the original question testable: keep the intent and the checks fixed, change only what the builder writes in, and measure. See the roadmap.
|
|
153
|
+
|
|
154
|
+
## Where it fits
|
|
155
|
+
|
|
156
|
+
| Approach | Examples | What Warrant adds |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| Spec-driven development | Spec Kit, Kiro, OpenSpec | These organize the work up front, but humans still review the code. Warrant replaces that review with evidence and gates. |
|
|
159
|
+
| Languages built for AI | Zero, Vera, Aver | Warrant works with any language, so any of these can be what the builder writes. |
|
|
160
|
+
| Verified code | vericoding, Axon, Lean, Dafny | Proof checkers plug in as checks with `proved` strength. |
|
|
161
|
+
| Dark factories | StrongDM, OpenAI's harness engineering | The same ideas, hidden scenarios and evidence instead of review, as an open protocol instead of in-house practice. |
|
|
162
|
+
|
|
163
|
+
## Roadmap
|
|
164
|
+
|
|
165
|
+
Each item is an issue labelled [help wanted](https://github.com/mv2a/warrant/labels/help%20wanted). Pick one up.
|
|
166
|
+
|
|
167
|
+
- [ ] **Signed evidence** ([#1](https://github.com/mv2a/warrant/issues/1)): DSSE envelopes, Sigstore, and anchoring the ledger head beyond the builder's reach
|
|
168
|
+
- [ ] **Sandboxed verification** ([#2](https://github.com/mv2a/warrant/issues/2)): checks run in containers, because the builder's code is untrusted
|
|
169
|
+
- [ ] **Integrations** ([#3](https://github.com/mv2a/warrant/issues/3), [#4](https://github.com/mv2a/warrant/issues/4)): a GitHub Action gate, and an MCP server through which builders request verification
|
|
170
|
+
- [ ] **Check quality** ([#5](https://github.com/mv2a/warrant/issues/5)): mutation testing as evidence about the checks themselves
|
|
171
|
+
- [ ] **Proof and property adapters** ([#6](https://github.com/mv2a/warrant/issues/6)): Lean, Dafny, Verus, Hypothesis
|
|
172
|
+
- [ ] **Judged checks** ([#7](https://github.com/mv2a/warrant/issues/7)): scenarios evaluated by language models over repeated trials, clearly labelled `judged`
|
|
173
|
+
- [ ] **Arena** ([#8](https://github.com/mv2a/warrant/issues/8)): the same intent and checks with builders writing Python, TypeScript, Rust, Zero, Vera or a Warrant-native representation, measuring warrants earned, cost and defects that got through
|
|
174
|
+
- [ ] **Dogfooding** ([#9](https://github.com/mv2a/warrant/issues/9)): develop Warrant under Warrant
|
|
175
|
+
|
|
176
|
+
## Limitations of v0.1
|
|
177
|
+
|
|
178
|
+
- **No sandbox.** The builder's code runs with your permissions during verification. Run `warrant verify` in a container or virtual machine for anything you don't trust.
|
|
179
|
+
- **No signatures.** The ledger reveals partial edits but can be rewritten wholesale by anyone with write access. Keep a copy of its head digest elsewhere.
|
|
180
|
+
- **Separation is up to you.** Warrant refuses to run with hidden checks inside the workspace, but keeping builders away from the control side depends on your setup.
|
|
181
|
+
- **Checks can be weak.** Coverage says a promise is checked, not that it is checked well. The principal's review of the checks is the root of trust.
|
|
182
|
+
|
|
183
|
+
## Contributing
|
|
184
|
+
|
|
185
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Critique of the specification is as valuable as code, and the best place for it is [Discussions](https://github.com/mv2a/warrant/discussions).
|
|
186
|
+
|
|
187
|
+
## License
|
|
188
|
+
|
|
189
|
+
[Apache-2.0](LICENSE)
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Warrant
|
|
2
|
+
|
|
3
|
+
[](https://github.com/mv2a/warrant/actions/workflows/ci.yml)
|
|
4
|
+
|
|
5
|
+
**Humans state intent. Agents write the code. Evidence decides what ships.**
|
|
6
|
+
|
|
7
|
+
Warrant is an open protocol, with a reference command-line tool, for software that AI agents build and maintain while humans direct it without reading the code.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
> **Status: v0.1, experimental.** The [specification](SPEC.md) is a draft and the tool is a reference implementation, not a hardened product. Critique is very welcome.
|
|
12
|
+
|
|
13
|
+
## The problem
|
|
14
|
+
|
|
15
|
+
Coding agents now write whole codebases. OpenAI built a product of about a million lines with no hand-written code. Sixteen Claude agents wrote a C compiler that builds Linux. StrongDM runs a team whose rules say humans neither write nor review code. ([Sources](PRIOR-ART.md#5-dark-factories-agents-running-the-lifecycle).)
|
|
16
|
+
|
|
17
|
+
Nobody can review that much code, and skipping review without replacing it has gone badly: agents game the tests they can see, ship insecure code, and delete production data. Across everything we surveyed, the projects that work without humans reading the code have one thing in common. They replaced code review with **independent evidence**: hidden test scenarios, machine-checked proofs, or comparison against a trusted reference.
|
|
18
|
+
|
|
19
|
+
Warrant turns that practice into an open protocol that works with any agent and any language.
|
|
20
|
+
|
|
21
|
+
## How it works
|
|
22
|
+
|
|
23
|
+
```mermaid
|
|
24
|
+
flowchart LR
|
|
25
|
+
P([Principal]) -- intent --> B{{Builder}}
|
|
26
|
+
P -- approved checks --> E{{Examiner}}
|
|
27
|
+
B -- code --> E
|
|
28
|
+
E -- evidence --> G{{Gatekeeper}}
|
|
29
|
+
G -- warrant or denial --> L[(Ledger)]
|
|
30
|
+
L -- report --> P
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
1. A **principal**, the person accountable for the outcome, writes the **intent**: promises in plain language, each with an ID.
|
|
34
|
+
2. An **examiner** drafts **checks** for those promises. Some are visible to the builder and the rest stay hidden. The principal approves them, and only approved checks count.
|
|
35
|
+
3. A **builder**, a coding agent, writes the code. It sees the intent and the visible checks, and nothing else.
|
|
36
|
+
4. The examiner runs every check against an exact snapshot of the code and records the **evidence**.
|
|
37
|
+
5. A deterministic **gatekeeper** applies the policy to the evidence and issues a **warrant**, or a denial, for each action, such as merge or release.
|
|
38
|
+
6. Everything goes into an append-only **ledger**. The principal reads which promises were kept and which were broken, not code.
|
|
39
|
+
7. When something goes wrong in production, the principal records an **incident**, and releases stop until it has become a check.
|
|
40
|
+
|
|
41
|
+
In argument theory, a *warrant* is the rule that lets evidence support a claim. Here it is also the permission that follows.
|
|
42
|
+
|
|
43
|
+
## Try it
|
|
44
|
+
|
|
45
|
+
You need Python 3.11 or newer, and nothing else.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/mv2a/warrant.git
|
|
49
|
+
cd warrant
|
|
50
|
+
examples/pricing/demo.sh
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The [example](examples/pricing) is a small shop's checkout pricing. Its [intent](examples/pricing/intent.md) makes nine promises, such as "orders over $100.00 get 10% off" and "invalid requests are refused, never priced". Two candidate implementations were written by coding agents. You don't need to read either.
|
|
54
|
+
|
|
55
|
+
Candidate A passes every check it can see. The builder is told only which promises the hidden checks found unmet:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
$ warrant verify --workspace candidates/overfit --audience builder
|
|
59
|
+
Verified candidates/overfit (sha256:7bb39c5c3689) with 7 checks.
|
|
60
|
+
|
|
61
|
+
PASS P1 visible The quote command follows the published contract: valid requests get wh…
|
|
62
|
+
PASS P2 visible The three example orders in the intent are charged exactly what the int…
|
|
63
|
+
hidden checks: 3 passed, 2 did not
|
|
64
|
+
|
|
65
|
+
Promises the hidden checks found unmet:
|
|
66
|
+
C1 Money is counted in whole cents. A discount that works out to a fraction of a cent is rou…
|
|
67
|
+
C3 Invalid requests are refused, never priced. That includes a subtotal that is negative, fr…
|
|
68
|
+
Re-read those promises. The hidden checks won't say more.
|
|
69
|
+
|
|
70
|
+
$ warrant gate merge --workspace candidates/overfit
|
|
71
|
+
merge: DENIED for candidates/overfit (sha256:7bb39c5c3689)
|
|
72
|
+
- H2 failed
|
|
73
|
+
- H5 failed
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The principal's report explains the denial in terms of promises, not code:
|
|
77
|
+
|
|
78
|
+
| Clause | Promise | Checked by | Status |
|
|
79
|
+
|---|---|---|---|
|
|
80
|
+
| G1 | Orders with a subtotal over $100.00 get 10% off the subtotal. | H1 | ✅ Kept (tested) |
|
|
81
|
+
| G2 | Loyalty members never pay for shipping. Everyone else pays a flat $7.50. | H3 | ✅ Kept (tested) |
|
|
82
|
+
| C1 | Money is counted in whole cents. A discount that works out to a fraction of a cent is rounded down. | H2 | ❌ Broken |
|
|
83
|
+
| C3 | Invalid requests are refused, never priced. … | P1, H5 | ❌ Broken |
|
|
84
|
+
| … | *five more promises, all kept* | | |
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
subtotal 10015: expected a discount of 1001, got 1002
|
|
88
|
+
a fractional subtotal: expected a refusal (status 2, no output), got status 0 and {... 'total_cents': 870.5}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Candidate B earns warrants for both merge and release. Then a production incident is recorded, and releases stop until someone turns it into a check.
|
|
92
|
+
|
|
93
|
+
## The rules
|
|
94
|
+
|
|
95
|
+
1. **Humans own the definition of done.** Agents may draft checks, but only the principal's approval makes them binding. Any later change to the intent, the checks or the policy voids that approval.
|
|
96
|
+
2. **Builders never grade their own work.** Evidence comes from an examiner the builder can't influence.
|
|
97
|
+
3. **Hidden checks stay hidden.** Builders learn which promises failed, never how they were tested, so they have to satisfy the intent rather than the tests.
|
|
98
|
+
4. **Evidence is bound to exact content.** It names the precise snapshot of code and the precise version of the check. Change either one and the evidence no longer applies.
|
|
99
|
+
5. **No evidence, no warrant.** A missing result counts as a failure, and every promise needs a check.
|
|
100
|
+
6. **Gates are deterministic.** No model decides whether something ships.
|
|
101
|
+
7. **Everything is on the record.** The ledger is append-only and hash-chained.
|
|
102
|
+
|
|
103
|
+
## Use it
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pip install git+https://github.com/mv2a/warrant.git
|
|
107
|
+
warrant init my-service
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
| Command | Run by | What it does |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| `warrant check` | anyone | Validates the intent, checks and policy, and shows coverage and approval |
|
|
113
|
+
| `warrant approve --by NAME` | principal | Approves the current intent, checks and policy |
|
|
114
|
+
| `warrant brief` | orchestrator | Prints the builder's brief, which never includes hidden checks |
|
|
115
|
+
| `warrant verify [--audience builder]` | examiner | Runs the checks on a snapshot of the workspace and records evidence |
|
|
116
|
+
| `warrant gate ACTION` | gatekeeper | Issues a warrant or a denial, and exits non-zero on denial so CI can use it |
|
|
117
|
+
| `warrant report` | principal | Shows promises kept and broken, failures, caveats and incidents |
|
|
118
|
+
| `warrant incident add ID "WHAT HAPPENED" --by NAME` | principal | Records a problem found in production |
|
|
119
|
+
| `warrant log [--verify]` | anyone | Shows the ledger, or checks that it is intact |
|
|
120
|
+
|
|
121
|
+
A check is any command: a test suite, a property-based test, a proof checker such as `lean` or `dafny verify`, a security scanner, or a benchmark. It passes when it exits with status 0. [SPEC.md](SPEC.md) defines the file formats, the evidence and the ledger.
|
|
122
|
+
|
|
123
|
+
## Why not a new programming language?
|
|
124
|
+
|
|
125
|
+
That's where this project started. Programming languages were designed for humans, so shouldn't AI get its own, maybe even raw binary? We [surveyed the field](PRIOR-ART.md) before writing any code:
|
|
126
|
+
|
|
127
|
+
- At least a dozen languages built for AI have launched since 2025, most notably Vercel Labs' Zero. None has shown an advantage on real projects, and models remain far stronger in the languages they have the most training data for.
|
|
128
|
+
- Generating binary directly does worst of all: output is longer, accuracy is lower, and nothing is left that can be verified.
|
|
129
|
+
- In every case we found, what made agent-written code trustworthy was the evidence, not the language.
|
|
130
|
+
|
|
131
|
+
So Warrant doesn't care what builders write. The language that matters is the one humans and agents use to agree on what "done" means. That also makes the original question testable: keep the intent and the checks fixed, change only what the builder writes in, and measure. See the roadmap.
|
|
132
|
+
|
|
133
|
+
## Where it fits
|
|
134
|
+
|
|
135
|
+
| Approach | Examples | What Warrant adds |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| Spec-driven development | Spec Kit, Kiro, OpenSpec | These organize the work up front, but humans still review the code. Warrant replaces that review with evidence and gates. |
|
|
138
|
+
| Languages built for AI | Zero, Vera, Aver | Warrant works with any language, so any of these can be what the builder writes. |
|
|
139
|
+
| Verified code | vericoding, Axon, Lean, Dafny | Proof checkers plug in as checks with `proved` strength. |
|
|
140
|
+
| Dark factories | StrongDM, OpenAI's harness engineering | The same ideas, hidden scenarios and evidence instead of review, as an open protocol instead of in-house practice. |
|
|
141
|
+
|
|
142
|
+
## Roadmap
|
|
143
|
+
|
|
144
|
+
Each item is an issue labelled [help wanted](https://github.com/mv2a/warrant/labels/help%20wanted). Pick one up.
|
|
145
|
+
|
|
146
|
+
- [ ] **Signed evidence** ([#1](https://github.com/mv2a/warrant/issues/1)): DSSE envelopes, Sigstore, and anchoring the ledger head beyond the builder's reach
|
|
147
|
+
- [ ] **Sandboxed verification** ([#2](https://github.com/mv2a/warrant/issues/2)): checks run in containers, because the builder's code is untrusted
|
|
148
|
+
- [ ] **Integrations** ([#3](https://github.com/mv2a/warrant/issues/3), [#4](https://github.com/mv2a/warrant/issues/4)): a GitHub Action gate, and an MCP server through which builders request verification
|
|
149
|
+
- [ ] **Check quality** ([#5](https://github.com/mv2a/warrant/issues/5)): mutation testing as evidence about the checks themselves
|
|
150
|
+
- [ ] **Proof and property adapters** ([#6](https://github.com/mv2a/warrant/issues/6)): Lean, Dafny, Verus, Hypothesis
|
|
151
|
+
- [ ] **Judged checks** ([#7](https://github.com/mv2a/warrant/issues/7)): scenarios evaluated by language models over repeated trials, clearly labelled `judged`
|
|
152
|
+
- [ ] **Arena** ([#8](https://github.com/mv2a/warrant/issues/8)): the same intent and checks with builders writing Python, TypeScript, Rust, Zero, Vera or a Warrant-native representation, measuring warrants earned, cost and defects that got through
|
|
153
|
+
- [ ] **Dogfooding** ([#9](https://github.com/mv2a/warrant/issues/9)): develop Warrant under Warrant
|
|
154
|
+
|
|
155
|
+
## Limitations of v0.1
|
|
156
|
+
|
|
157
|
+
- **No sandbox.** The builder's code runs with your permissions during verification. Run `warrant verify` in a container or virtual machine for anything you don't trust.
|
|
158
|
+
- **No signatures.** The ledger reveals partial edits but can be rewritten wholesale by anyone with write access. Keep a copy of its head digest elsewhere.
|
|
159
|
+
- **Separation is up to you.** Warrant refuses to run with hidden checks inside the workspace, but keeping builders away from the control side depends on your setup.
|
|
160
|
+
- **Checks can be weak.** Coverage says a promise is checked, not that it is checked well. The principal's review of the checks is the root of trust.
|
|
161
|
+
|
|
162
|
+
## Contributing
|
|
163
|
+
|
|
164
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Critique of the specification is as valuable as code, and the best place for it is [Discussions](https://github.com/mv2a/warrant/discussions).
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
[Apache-2.0](LICENSE)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "warrant-cli"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Humans state intent. Agents write the code. Evidence decides what ships."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [{ name = "mv2a" }]
|
|
13
|
+
keywords = ["ai-agents", "coding-agents", "verification", "evidence", "spec-driven-development"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
20
|
+
"Topic :: Software Development :: Testing",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://github.com/mv2a/warrant"
|
|
25
|
+
Specification = "https://github.com/mv2a/warrant/blob/main/SPEC.md"
|
|
26
|
+
Issues = "https://github.com/mv2a/warrant/issues"
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
warrant = "warrant.cli:main"
|
|
30
|
+
|
|
31
|
+
[tool.setuptools]
|
|
32
|
+
packages = ["warrant"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.dynamic]
|
|
35
|
+
version = { attr = "warrant.__version__" }
|