coherence-check 0.6.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.
- coherence_check-0.6.0/LICENSE +202 -0
- coherence_check-0.6.0/NOTICE +4 -0
- coherence_check-0.6.0/PKG-INFO +342 -0
- coherence_check-0.6.0/README.md +311 -0
- coherence_check-0.6.0/pyproject.toml +57 -0
- coherence_check-0.6.0/setup.cfg +4 -0
- coherence_check-0.6.0/src/coherence/__init__.py +26 -0
- coherence_check-0.6.0/src/coherence/__main__.py +437 -0
- coherence_check-0.6.0/src/coherence/audit/__init__.py +0 -0
- coherence_check-0.6.0/src/coherence/audit/scope.py +156 -0
- coherence_check-0.6.0/src/coherence/audit/transcript.py +213 -0
- coherence_check-0.6.0/src/coherence/ci/__init__.py +15 -0
- coherence_check-0.6.0/src/coherence/ci/session.py +304 -0
- coherence_check-0.6.0/src/coherence/claimproof/__init__.py +3 -0
- coherence_check-0.6.0/src/coherence/claimproof/steps.py +101 -0
- coherence_check-0.6.0/src/coherence/core/__init__.py +13 -0
- coherence_check-0.6.0/src/coherence/core/fact.py +211 -0
- coherence_check-0.6.0/src/coherence/core/spine.py +209 -0
- coherence_check-0.6.0/src/coherence/core/types.py +115 -0
- coherence_check-0.6.0/src/coherence/decisions/__init__.py +3 -0
- coherence_check-0.6.0/src/coherence/decisions/log.py +105 -0
- coherence_check-0.6.0/src/coherence/evolve/__init__.py +11 -0
- coherence_check-0.6.0/src/coherence/evolve/dominos.py +256 -0
- coherence_check-0.6.0/src/coherence/evolve/memory.py +231 -0
- coherence_check-0.6.0/src/coherence/health.py +193 -0
- coherence_check-0.6.0/src/coherence/py.typed +1 -0
- coherence_check-0.6.0/src/coherence/replay/__init__.py +3 -0
- coherence_check-0.6.0/src/coherence/replay/engine.py +85 -0
- coherence_check-0.6.0/src/coherence/review/__init__.py +3 -0
- coherence_check-0.6.0/src/coherence/review/triage.py +76 -0
- coherence_check-0.6.0/src/coherence/skills/__init__.py +3 -0
- coherence_check-0.6.0/src/coherence/skills/audit.py +73 -0
- coherence_check-0.6.0/src/coherence_check.egg-info/PKG-INFO +342 -0
- coherence_check-0.6.0/src/coherence_check.egg-info/SOURCES.txt +43 -0
- coherence_check-0.6.0/src/coherence_check.egg-info/dependency_links.txt +1 -0
- coherence_check-0.6.0/src/coherence_check.egg-info/entry_points.txt +2 -0
- coherence_check-0.6.0/src/coherence_check.egg-info/requires.txt +2 -0
- coherence_check-0.6.0/src/coherence_check.egg-info/top_level.txt +1 -0
- coherence_check-0.6.0/tests/test_audit.py +120 -0
- coherence_check-0.6.0/tests/test_ci_session.py +150 -0
- coherence_check-0.6.0/tests/test_coherence.py +70 -0
- coherence_check-0.6.0/tests/test_evolve.py +93 -0
- coherence_check-0.6.0/tests/test_fact.py +54 -0
- coherence_check-0.6.0/tests/test_health.py +43 -0
- coherence_check-0.6.0/tests/test_scope.py +61 -0
|
@@ -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,342 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: coherence-check
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Your AI agent says the work is done. Coherence makes it prove it — evidence, not claims, with tamper-evident CI sessions.
|
|
5
|
+
Author-email: AurumFlux <security@aurumflux.co>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/aurumflux20/coherence
|
|
8
|
+
Project-URL: Documentation, https://github.com/aurumflux20/coherence/blob/main/docs/INDEX.md
|
|
9
|
+
Project-URL: Repository, https://github.com/aurumflux20/coherence
|
|
10
|
+
Project-URL: Issues, https://github.com/aurumflux20/coherence/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/aurumflux20/coherence/blob/main/CHANGELOG.md
|
|
12
|
+
Project-URL: Bug Tracker, https://github.com/aurumflux20/coherence/issues
|
|
13
|
+
Keywords: agents,ai,claim,proof,evidence,mcp,code-review,developer-tools,verification
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Classifier: Topic :: Security
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
License-File: NOTICE
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# Coherence
|
|
33
|
+
|
|
34
|
+
[](https://github.com/aurumflux20/coherence/actions/workflows/ci.yml)
|
|
35
|
+
[](LICENSE)
|
|
36
|
+
[](https://www.python.org/downloads/)
|
|
37
|
+
|
|
38
|
+
### Your agent says the work is done. This makes it prove it.
|
|
39
|
+
|
|
40
|
+
An AI agent writes code and reports back: *"Tests passed. Done."* But "done" was
|
|
41
|
+
a sentence in a chat window, not an exit code. Nobody re-ran it. The spec from
|
|
42
|
+
three messages ago got quietly dropped. The PR is a wall of changes with no
|
|
43
|
+
signal about what actually needs a human's eyes.
|
|
44
|
+
|
|
45
|
+
Coherence is a small Python library and command-line tool that records the
|
|
46
|
+
difference between **what an agent said** and **what it actually proved** — and
|
|
47
|
+
always keeps a **next step**. It has one rule:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
Nothing is done unless there is evidence.
|
|
51
|
+
Nothing is finished unless there is a next step.
|
|
52
|
+
Nothing is remembered unless it was actually done.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
No dependencies. Pure standard library. It runs where your code runs.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## See it in 10 seconds
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/aurumflux20/coherence && cd coherence
|
|
64
|
+
pip install -e . && python -m coherence tamper-demo
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
1. An agent runs a check. It FAILS — so no proof is recorded.
|
|
69
|
+
coherence check -> exit 1 (open fact, no evidence)
|
|
70
|
+
|
|
71
|
+
2. The agent edits its own session file to claim it passed.
|
|
72
|
+
forged: evidence = "exit_code=0 ..."
|
|
73
|
+
|
|
74
|
+
3. The check runs again. The hash chain does not match.
|
|
75
|
+
coherence check -> exit 3 TAMPERED at entry 0
|
|
76
|
+
|
|
77
|
+
A forged green is caught. That is the whole idea.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Runs in a throwaway temp directory; touches nothing of yours.
|
|
81
|
+
|
|
82
|
+
## Audit a real agent session — the confession is already on disk
|
|
83
|
+
|
|
84
|
+
Every coding agent writes a full transcript: every command, every real exit
|
|
85
|
+
code. Nobody reads it. `coherence audit` does — it pulls out every checkable
|
|
86
|
+
claim the agent made ("tests pass", "pushed to main") and checks each one
|
|
87
|
+
against what actually ran, in the same file:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
coherence audit ~/.claude/projects/<your-project>/<session>.jsonl
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
audited: 735 commands, 74 checkable claims
|
|
95
|
+
|
|
96
|
+
supported 20
|
|
97
|
+
weak evidence 11 (piped exit codes — pytest | tail class)
|
|
98
|
+
unsupported 41 (claims resting on nothing)
|
|
99
|
+
CONTRADICTED 2 (claimed success; its own transcript says failure)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
That output is real: the auditor's first run was on the 51 MB session of the
|
|
103
|
+
agent that built it. It flagged its own author — two success claims its own
|
|
104
|
+
transcript contradicts, and eleven "tests pass" claims whose only evidence was
|
|
105
|
+
a piped command (`pytest | tail` reports tail's exit code, not pytest's — a
|
|
106
|
+
mistake that same agent had made earlier in the same session).
|
|
107
|
+
|
|
108
|
+
Verdicts are heuristic pattern-matching, not magic: unusual phrasing slips
|
|
109
|
+
past, and only checkable claims (tests / build / push / commit) are judged.
|
|
110
|
+
The point is the direction of error — a claim with no evidence is flagged for
|
|
111
|
+
a human, never silently trusted. Exit codes: 0 all supported · 1 unsupported ·
|
|
112
|
+
2 contradicted.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## What did it touch — and what CAN'T we see?
|
|
117
|
+
|
|
118
|
+
`audit` catches a lie. `scope` catches a silence: did the agent do anything it
|
|
119
|
+
never mentioned? Reading a transcript can't prove a negative — a single
|
|
120
|
+
`bash deploy.sh` could hide anything — so `coherence scope` never claims full
|
|
121
|
+
visibility. It reports what's readable (files, pushes, hosts, installs) and
|
|
122
|
+
marks what ISN'T as **OPAQUE**, loudly, every time:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
coherence scope session.jsonl
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
files touched (394) repos pushed (13) network hosts contacted (20)
|
|
130
|
+
|
|
131
|
+
OPAQUE — effects this report CANNOT see (178)
|
|
132
|
+
line 428: cd ~/packages/seal && ... storm.py
|
|
133
|
+
why: runs a program file
|
|
134
|
+
|
|
135
|
+
VERDICT: BOUNDED — 178 command(s) could do anything this report cannot see.
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Same doctrine as the witness above: **unknown never collapses into "clean."**
|
|
139
|
+
A report exits non-zero the moment anything is opaque, even if everything
|
|
140
|
+
visible looks fine — a bounded answer that shows its edge beats a false
|
|
141
|
+
complete one. Real numbers from our own 741-command session, byte-verified
|
|
142
|
+
before publishing: [docs/provenance/](docs/provenance/).
|
|
143
|
+
|
|
144
|
+
## The problem it fixes
|
|
145
|
+
|
|
146
|
+
Agents write code fast, so the slow part is now a human checking it. And the
|
|
147
|
+
usual signals lie:
|
|
148
|
+
|
|
149
|
+
- **"Tests passed"** in a chat message is not the same as a green exit code.
|
|
150
|
+
- A spec agreed at the start of a task gets forgotten halfway through.
|
|
151
|
+
- The agent installed some skill or MCP tool and you have no record of what.
|
|
152
|
+
- A big agent-written PR gives you no idea which line actually matters.
|
|
153
|
+
|
|
154
|
+
Coherence turns each of those into a **Fact** — a claim, the evidence for it
|
|
155
|
+
(if any), and the next step. A claim with no evidence is simply **not done**,
|
|
156
|
+
and the code enforces that; you can't mark something proven without attaching
|
|
157
|
+
the proof.
|
|
158
|
+
|
|
159
|
+
**Who it's for:** engineers and tech leads who ship code with AI agents every
|
|
160
|
+
day and are tired of trusting "done" on faith.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Install
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
pip install "git+https://github.com/aurumflux20/coherence.git"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Or for local development:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
git clone https://github.com/aurumflux20/coherence.git
|
|
174
|
+
cd coherence
|
|
175
|
+
python3 -m venv .venv && source .venv/bin/activate
|
|
176
|
+
pip install -e .
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Requires:** Python 3.10 or newer. **No dependencies** — standard library only.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 60-second look
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
python3 -m coherence law # the whole idea in three sentences
|
|
187
|
+
python3 storm.py # the hostile proof — must exit 0
|
|
188
|
+
python3 -m coherence demo # a worked example
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
In code:
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
from coherence import Coherence
|
|
195
|
+
|
|
196
|
+
c = Coherence()
|
|
197
|
+
|
|
198
|
+
# the agent claims something in chat — recorded, but NOT counted as done
|
|
199
|
+
c.said("tests passed", next="actually run pytest and attach the exit code")
|
|
200
|
+
|
|
201
|
+
# now prove it — evidence attached, so it counts
|
|
202
|
+
c.prove("pytest -q", evidence="exit_code=0", next="chain complete")
|
|
203
|
+
|
|
204
|
+
print(c.plain_english())
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`said()` records a claim with no proof. `prove()` refuses to exist without
|
|
208
|
+
evidence — it will raise rather than let you record a lie.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Stop agents faking a green check in CI
|
|
213
|
+
|
|
214
|
+
Drop this into a pull-request workflow and an agent can no longer say "all
|
|
215
|
+
green" without the evidence to back it:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
python3 -m coherence prove-cmd "pytest -q" --claim "unit tests"
|
|
219
|
+
python3 -m coherence check # exits 1 if any claim is still unproven
|
|
220
|
+
python3 -m coherence report --out coherence-report.md
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Copy-paste GitHub Action: [docs/CI.md](docs/CI.md). This repo runs it on its own
|
|
224
|
+
PRs — see `.github/workflows/coherence-pr.yml`.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Proof, not promises
|
|
229
|
+
|
|
230
|
+
Everything above is tested the hostile way. `storm.py` throws hundreds of
|
|
231
|
+
racing, lying, half-finished claims at the rule and checks it never bends:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
[PASS] 500 chat claims → 0 counted as done
|
|
235
|
+
[PASS] a claim with no next step is rejected, 100/100 under a race
|
|
236
|
+
[PASS] memory refuses to store anything that was never proven
|
|
237
|
+
[PASS] CI gate: unproven work fails, proven-only work passes
|
|
238
|
+
RESULT: 7/7 checks PASS
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Run it yourself — it must exit 0. Full write-up: [STORM-PROOF.md](STORM-PROOF.md).
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## GitHub Action — the gate in one block
|
|
246
|
+
|
|
247
|
+
```yaml
|
|
248
|
+
permissions:
|
|
249
|
+
pull-requests: write # for the sticky report comment
|
|
250
|
+
|
|
251
|
+
steps:
|
|
252
|
+
- uses: actions/checkout@v4
|
|
253
|
+
- uses: aurumflux20/coherence@v1
|
|
254
|
+
with:
|
|
255
|
+
prove: |
|
|
256
|
+
pytest -q
|
|
257
|
+
npm test
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Each command becomes evidence. The PR fails on claims without proof, on an
|
|
261
|
+
empty session, or — loudest of all — on a session that was edited after the
|
|
262
|
+
facts were recorded (exit 3). A sticky comment on the PR shows what was proven
|
|
263
|
+
and what is still open, so reviewers see it without installing anything.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Trust boundary — who runs the check
|
|
268
|
+
|
|
269
|
+
This matters most, so it goes first.
|
|
270
|
+
|
|
271
|
+
The session file records what was proven. **The protection only holds when
|
|
272
|
+
something the agent does not control runs the check** — normally your CI, not
|
|
273
|
+
the agent under review. If the agent that writes the session can also edit the
|
|
274
|
+
file and then declare itself green, the guarantee is gone.
|
|
275
|
+
|
|
276
|
+
Coherence closes the tampering half of that: every session entry is
|
|
277
|
+
hash-chained, so editing, deleting, or reordering a recorded fact breaks the
|
|
278
|
+
chain, and `coherence check` fails with exit code 3 at the exact entry that was
|
|
279
|
+
changed — a forged "green" is caught, not trusted.
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# In CI (not the agent): the check re-verifies the chain before trusting a
|
|
283
|
+
# single fact. A tampered session fails here even if every fact reads "proven".
|
|
284
|
+
coherence check # exit 0 pass · 1 open facts · 2 empty · 3 tampered
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
What it still does **not** do: stop an agent that never records a fact at all,
|
|
288
|
+
or one running as the same identity as your CI with write access to the run
|
|
289
|
+
itself. Chaining makes after-the-fact edits detectable; it does not make the
|
|
290
|
+
writer honest. Run the check as a step your agent cannot rewrite.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Honest limits
|
|
295
|
+
|
|
296
|
+
Printed here so you find them now, not later:
|
|
297
|
+
|
|
298
|
+
| What it does | What it does not do |
|
|
299
|
+
|---|---|
|
|
300
|
+
| Record claim vs. evidence, always with a next step | Stop a rogue tool that has your keys and ignores it |
|
|
301
|
+
| Run locally, standard library only | Replace GitHub, your CI, or your test runner |
|
|
302
|
+
| Keep an optional lesson memory on disk | Ship as a hosted multi-tenant service |
|
|
303
|
+
|
|
304
|
+
Coherence records what was proven. It does not *do* the proving for you — you
|
|
305
|
+
still write the test; it just refuses to let "done" mean anything less.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Documentation
|
|
310
|
+
|
|
311
|
+
| Doc | What's in it |
|
|
312
|
+
|-----|--------------|
|
|
313
|
+
| [docs/INDEX.md](docs/INDEX.md) | Full map |
|
|
314
|
+
| [docs/CI.md](docs/CI.md) | The PR check and badge |
|
|
315
|
+
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | How it's built |
|
|
316
|
+
| [CHANGELOG.md](CHANGELOG.md) | Versions |
|
|
317
|
+
| [SUPPORT.md](SUPPORT.md) | Help + related projects |
|
|
318
|
+
|
|
319
|
+
Security issues: please report privately per [SECURITY.md](SECURITY.md), not as
|
|
320
|
+
a public issue.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Related projects (separate repos)
|
|
325
|
+
|
|
326
|
+
| Repo | Role |
|
|
327
|
+
|------|------|
|
|
328
|
+
| [seal](https://github.com/aurumflux20/seal) | Exactly-once admission for agent money actions |
|
|
329
|
+
| [effectfence](https://github.com/aurumflux20/effectfence) | In-process fence against double-firing effects |
|
|
330
|
+
| [fencescan](https://github.com/aurumflux20/fencescan) | Static scan for double-effect risks |
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## License
|
|
335
|
+
|
|
336
|
+
**Apache License 2.0** — see [LICENSE](LICENSE).
|
|
337
|
+
|
|
338
|
+
In plain words: use it, change it, ship it inside your own product, even sell
|
|
339
|
+
something built on top of it — no restrictions, no fees, no asking. This is
|
|
340
|
+
built to help developers; the only ask back is a ⭐ if it did.
|
|
341
|
+
|
|
342
|
+
© 2026 AurumFlux (A. Kaur)
|