hypgraph 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.5
2
+ Name: hypgraph
3
+ Version: 0.1.0
4
+ Summary: The evidence layer for AI research agents: a hash-chained research record that checks every claim as it is written and derives how well each is known.
5
+ Project-URL: Homepage, https://hypgraph.com
6
+ Project-URL: Documentation, https://hypgraph.com/engineers/
7
+ Project-URL: Changelog, https://github.com/voodoomods/hypgraph/blob/main/CHANGELOG.md
8
+ Project-URL: Source, https://github.com/voodoomods/hypgraph
9
+ Author: Nicolas Houghtaling
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: agent-skills,ai-agents,evaluation,hypothesis,mcp,provenance,reproducibility,research
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.10
22
+ Provides-Extra: all
23
+ Requires-Dist: fastmcp>=2.12; extra == 'all'
24
+ Requires-Dist: pytest>=8; extra == 'all'
25
+ Provides-Extra: mcp
26
+ Requires-Dist: fastmcp>=2.12; extra == 'mcp'
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest>=8; extra == 'test'
29
+ Description-Content-Type: text/markdown
30
+
31
+ <p align="center"><img src="https://hypgraph.com/assets/hypgraph.svg" width="72" alt=""></p>
32
+
33
+ <h1 align="center">HypGraph</h1>
34
+ <p align="center"><b>Don't believe the hype. Test the hyp.</b><br>
35
+ The evidence layer for AI research agents.<br>
36
+ <a href="https://hypgraph.com">hypgraph.com</a> · <a href="https://hypgraph.com/agents/">for agents</a> ·
37
+ <a href="https://hypgraph.com/engineers/">for engineers</a> · <a href="https://hypgraph.com/spec/">record format</a></p>
38
+
39
+ ---
40
+
41
+ Agents doing research write fluent summaries. Some of the numbers in them match no result. "Always" gets written
42
+ about one run, a search too weak to find anything becomes "ruled out", and three copies of one result get counted as
43
+ three lines of evidence. HypGraph is the record they write into instead. It checks every claim as it's written, so
44
+ those claims can't get in:
45
+
46
+ ```text
47
+ $ hypgraph add claim statement="The fine-tune is 5 points better than the baseline." scope="2,000 held-out items, greedy decoding, one seed." --link "supports:from:RS1:the eval run"
48
+ refused: claim refused:
49
+ - numbers in the statement that no bound measurement, the scope or the investigation's constants account for: 5 — bind them to result fields (measurements) or move design constants into the scope
50
+ ```
51
+
52
+ (The result said 1,624 against 1,568 correct out of 2,000. That's 2.8 points.)
53
+
54
+ Every refusal says what to fix, so an agent can act on it. Nothing in the record is ever *set* as known. How well
55
+ each claim is known is **derived on every read**:
56
+
57
+ - **reviewed, and which version?** Only named reviewers count, and never on their own work. A revised claim goes back
58
+ to unchecked.
59
+ - **does it rest on something that fell?** Withdraw a premise and everything built on it is flagged **AT RISK**. A
60
+ decision whose evidence changed is flagged **REVISIT**.
61
+ - **how many independent lines?** Results that share a run, a data file or a source count **once**.
62
+ - **how strong is the best one?** From an agent's report, through a run your job runner recorded and a separate
63
+ implementation, up to a replication on new data.
64
+
65
+ Every write is an event in a **SHA-256 hash chain**. A record can be handed to a reviewer, a regulator or another
66
+ team, and they can verify it without trusting you.
67
+
68
+ ## Connect your agent
69
+
70
+ ```bash
71
+ pip install "hypgraph[mcp]"
72
+ claude mcp add hypgraph -- hypgraph --db study.hypgraph --as claude mcp # any MCP client works
73
+ hypgraph skill --install # + the Agent Skill (.claude/skills/hypgraph/SKILL.md)
74
+ ```
75
+
76
+ The server writes as one author, fixed when it starts. The agent can't pass another name or write as your job runner,
77
+ and its verdicts count only if you name it as a reviewer. Tools: `overview`, `find`, `show`, `start_investigation`,
78
+ `add`, `link`, `revise`, `withdraw`, `retract_link`, `review`, `next_experiments`, `work_queue`, `claim_work`,
79
+ `register_run`, `report`, `verify`, `schema`. The method is in [AGENTS.md](https://github.com/voodoomods/hypgraph/blob/main/AGENTS.md); the short version is
80
+ [llms.txt](https://hypgraph.com/llms.txt).
81
+
82
+ ## Wire it into your system
83
+
84
+ The core is one Python package with no dependencies. You decide who is trusted to do what:
85
+
86
+ ```python
87
+ from hypgraph import Graph, Policy
88
+
89
+ g = Graph("research.hypgraph",
90
+ policy=Policy(reviewers={"critic", "stats"}, # whose verdicts count
91
+ instrument="runner"), # the only author that files lab-recorded runs
92
+ spend=my_ledger.spend) # optional: prices the work behind each investigation
93
+
94
+ with g.writing_for(task_id): # every event carries the task, for cost tracing
95
+ g.create(author=agent_name, type="claim", inv=inv, fields={...}, links=[...])
96
+ ```
97
+
98
+ - **Multi-agent:** give each agent its own author name. Make your critic agents reviewers. Have your job runner
99
+ write as the instrument, so its runs count as recorded, not reported.
100
+ - **Your web framework:** `hypgraph.server.dispatch(graph, method, path, query, body)` is the JSON API, and
101
+ `hypgraph.ui.static_dir()` is the Atlas explorer to mount next to it.
102
+ - **CI:** `hypgraph export -o record.bundle.json && hypgraph verify record.bundle.json`. The bundle is a single file
103
+ your reviewers or auditors can check with SHA-256, in any language or in the browser.
104
+
105
+ The full guide is at [hypgraph.com/engineers](https://hypgraph.com/engineers/).
106
+
107
+ ## Try it
108
+
109
+ ```bash
110
+ pip install hypgraph
111
+ hypgraph demo # a complete worked investigation (Broad Street, 1854) built into ./research.hypgraph
112
+ hypgraph serve # explore it in the Atlas: http://127.0.0.1:8765
113
+ hypgraph report # the facts, generated from the record
114
+ ```
115
+
116
+ Or try to get a claim past the real engine in your browser: [hypgraph.com/play](https://hypgraph.com/play/).
117
+
118
+ ## Where it came from
119
+
120
+ HypGraph is the research graph of PegasusDMZ, where a team of AI agents runs long investigations under governed
121
+ egress, pulled out so anyone can use it. Each rule exists because the agents made the mistake behind it:
122
+ - a validation that was blind to the answer;
123
+ - a null model that broke the system's own rules;
124
+ - a summary whose numbers matched no result;
125
+ - "never" written about something that happened once in a thousand.
126
+
127
+ PegasusDMZ is the reference deployment, and its Atlas is built from this package. Against PegasusDMZ's live record
128
+ (1,357 events, 790 nodes), the library derives the same standing for every node as the engine it replaced.
129
+
130
+ ## Performance
131
+
132
+ The engine is pure Python and stays fast at the sizes research records reach. At 10,000 nodes, deriving every node's
133
+ standing takes 0.09 s, reading one node 0.3 ms, and a write about 10 ms, mostly SQLite committing to disk. A write
134
+ costs what it touches: cached standing is kept for every node the write can't affect, and a randomized suite checks
135
+ that against a full rebuild.
136
+
137
+ ## License
138
+
139
+ Code: [Apache-2.0](https://github.com/voodoomods/hypgraph/blob/main/LICENSE). The record format ([docs/spec.md](https://github.com/voodoomods/hypgraph/blob/main/docs/spec.md)) and the docs: CC BY 4.0. Cite it with
140
+ [CITATION.cff](https://github.com/voodoomods/hypgraph/blob/main/CITATION.cff).
@@ -0,0 +1,31 @@
1
+ hypgraph/__init__.py,sha256=ZEKRQZuhr-ayTp4xpBXOztL5V4vMqYFXs0aZsX59hzU,1364
2
+ hypgraph/__main__.py,sha256=k1ocEWawweo1qCJWNFAAvyxz3tcY13dzvCenHszij30,48
3
+ hypgraph/bundle.py,sha256=IbWW79LC8CNBNDnS4MiKjY0zXgqm4dJ_YD2x4l9Fn-Y,12252
4
+ hypgraph/checks.py,sha256=sBg6Ttv5duUQO4tu4voMYlh0n3WaWgwJSWbKozQq-Zg,7617
5
+ hypgraph/cli.py,sha256=U8srbeuaDKN_0ebmgr6TcGCSYBZU4aTzXjHUnF_vrFA,20192
6
+ hypgraph/derive.py,sha256=hKqx24nomHZ3Ra6TbUH3aw9y3UQnzb6b-BjHxfaeedQ,17419
7
+ hypgraph/graph.py,sha256=ijBKoRAKCe9EYLAuTaTb3Z9uxs5VoSEHjvpL29-tDUQ,51458
8
+ hypgraph/mcp.py,sha256=c1_wZTI59Cb2gHj6lf_zurptE3DJlkPUA0k1pXnz_Qs,27119
9
+ hypgraph/plan.py,sha256=Y-oc2tauKDMVwU-Xlwurx9SvtOxaUf0-whcFztZljV0,18385
10
+ hypgraph/policy.py,sha256=Ti7mGfWT-5D7pxhHWG-LfuNUkH7IY717-TZyPzcRMpk,2422
11
+ hypgraph/schema.py,sha256=3CfW6gvoSQrk5Sk-OYHA0NiZ5tVc0rZ-HsOq3xD5pe8,9423
12
+ hypgraph/server.py,sha256=axR2GX_FTzkmboQ9iTfyhnQsdW06IYpX848gLNNcoU4,9658
13
+ hypgraph/store.py,sha256=fWqUzuEpk2Hp0JKOKO5kxj8jsWR0KAKsTTPcrJROYXM,7104
14
+ hypgraph/demos/__init__.py,sha256=5P5qQgNhBcQJSM4vKdrwIQSen8Fxd_EI4tk0CrP1lFw,170
15
+ hypgraph/demos/broad_street.py,sha256=unOtdkNdZZaH9JvnMTnNQWiS1USch4zyf7_pE9NKo6I,21286
16
+ hypgraph/skill/SKILL.md,sha256=Cihs3fhQXRdJkst93njB70qaozBMWK9cXuhTGMKk3Lw,6215
17
+ hypgraph/ui/__init__.py,sha256=02wAIFX-RnSUKsl-UE8desdyOk0UXGIvBY6meSrO2Fo,202
18
+ hypgraph/ui/atlas.css,sha256=3KKx2XyrBJypScUpV1TAshnizAOX72M-odB2x8K3yKw,14478
19
+ hypgraph/ui/atlas.js,sha256=q496F-QcaLYjPO-NdQbuv9itY-ulZQQPjSEkFKB3ymA,73193
20
+ hypgraph/ui/hypgraph.svg,sha256=teCpsFUGTvJHdRdIfLZPZ-duoLDu_Qkemnt5FAJ5iPk,524
21
+ hypgraph/ui/index.html,sha256=FYxYEIjp2PhWThn9Zgr8b3QocTQAMkwbA4j_2_V6rCo,1120
22
+ hypgraph/ui/vendor/LICENSES.md,sha256=48AsjotWNYKT02K0Xdt2QNm8JUi6rfFIxT2QkOOLtqM,707
23
+ hypgraph/ui/vendor/cose-base.js,sha256=fK6VCb02I1pjqF5xyNn6LNC8HQwezFtac3l2850EDd8,118906
24
+ hypgraph/ui/vendor/cytoscape-fcose.js,sha256=SxyrIY10mWqlnNhHP5I5zGOYuMF3TYTX5ZrZpolZy1c,57239
25
+ hypgraph/ui/vendor/cytoscape.min.js,sha256=g-jFSmvsZVv9gd8H32BWScJor2muymel6i2lTqQtrIE,373304
26
+ hypgraph/ui/vendor/layout-base.js,sha256=9cZr4hycyhbE8lpXa_-9Fu0aSBgcHC3LuNkF7IIudrU,147898
27
+ hypgraph-0.1.0.dist-info/METADATA,sha256=-Mcv2UoehKP64k37tphHmKC-liyM__uXJxAYg7TsSeU,7544
28
+ hypgraph-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
29
+ hypgraph-0.1.0.dist-info/entry_points.txt,sha256=fICxx7M0m5-bb9PE6xqwTex-ypoiKvnRbT1hw5cnTtw,47
30
+ hypgraph-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
31
+ hypgraph-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ hypgraph = hypgraph.cli:main
@@ -0,0 +1,201 @@
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.