parley-consensus 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. parley_consensus-0.2.0/LICENSE +202 -0
  2. parley_consensus-0.2.0/NOTICE +8 -0
  3. parley_consensus-0.2.0/PKG-INFO +322 -0
  4. parley_consensus-0.2.0/README.md +289 -0
  5. parley_consensus-0.2.0/parley/__init__.py +0 -0
  6. parley_consensus-0.2.0/parley/agent.py +37 -0
  7. parley_consensus-0.2.0/parley/consensus.py +94 -0
  8. parley_consensus-0.2.0/parley/elicit.py +519 -0
  9. parley_consensus-0.2.0/parley/mcp.py +438 -0
  10. parley_consensus-0.2.0/parley/net/__init__.py +2 -0
  11. parley_consensus-0.2.0/parley/net/bot.py +171 -0
  12. parley_consensus-0.2.0/parley/net/client.py +83 -0
  13. parley_consensus-0.2.0/parley/net/identity.py +116 -0
  14. parley_consensus-0.2.0/parley/net/profiles.py +47 -0
  15. parley_consensus-0.2.0/parley/preferences.py +51 -0
  16. parley_consensus-0.2.0/parley/ratify.py +132 -0
  17. parley_consensus-0.2.0/parley/spec.py +160 -0
  18. parley_consensus-0.2.0/parley/transcript.py +107 -0
  19. parley_consensus-0.2.0/parley_consensus.egg-info/PKG-INFO +322 -0
  20. parley_consensus-0.2.0/parley_consensus.egg-info/SOURCES.txt +48 -0
  21. parley_consensus-0.2.0/parley_consensus.egg-info/dependency_links.txt +1 -0
  22. parley_consensus-0.2.0/parley_consensus.egg-info/entry_points.txt +3 -0
  23. parley_consensus-0.2.0/parley_consensus.egg-info/requires.txt +8 -0
  24. parley_consensus-0.2.0/parley_consensus.egg-info/top_level.txt +1 -0
  25. parley_consensus-0.2.0/pyproject.toml +51 -0
  26. parley_consensus-0.2.0/setup.cfg +4 -0
  27. parley_consensus-0.2.0/tests/test_agent.py +59 -0
  28. parley_consensus-0.2.0/tests/test_build_static_demo.py +52 -0
  29. parley_consensus-0.2.0/tests/test_consensus.py +250 -0
  30. parley_consensus-0.2.0/tests/test_demo_server.py +64 -0
  31. parley_consensus-0.2.0/tests/test_deploy_config.py +43 -0
  32. parley_consensus-0.2.0/tests/test_elicit.py +460 -0
  33. parley_consensus-0.2.0/tests/test_identity.py +50 -0
  34. parley_consensus-0.2.0/tests/test_mcp.py +368 -0
  35. parley_consensus-0.2.0/tests/test_meeting_json.py +39 -0
  36. parley_consensus-0.2.0/tests/test_net.py +100 -0
  37. parley_consensus-0.2.0/tests/test_net_hardening.py +547 -0
  38. parley_consensus-0.2.0/tests/test_packaging.py +98 -0
  39. parley_consensus-0.2.0/tests/test_preferences.py +76 -0
  40. parley_consensus-0.2.0/tests/test_ratify.py +282 -0
  41. parley_consensus-0.2.0/tests/test_real_decision.py +420 -0
  42. parley_consensus-0.2.0/tests/test_real_decision_recipes.py +14 -0
  43. parley_consensus-0.2.0/tests/test_redteam.py +77 -0
  44. parley_consensus-0.2.0/tests/test_redteam_consensus.py +116 -0
  45. parley_consensus-0.2.0/tests/test_run_env_json.py +46 -0
  46. parley_consensus-0.2.0/tests/test_spec.py +103 -0
  47. parley_consensus-0.2.0/tests/test_transcript.py +304 -0
  48. parley_consensus-0.2.0/tests/test_verify_receipt.py +332 -0
  49. parley_consensus-0.2.0/tests/test_voice_brain.py +97 -0
  50. parley_consensus-0.2.0/tests/test_voice_gateway.py +93 -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,8 @@
1
+ Parley
2
+ Copyright 2026 Oleh Veheria and Parley contributors
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License in the LICENSE file or at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
@@ -0,0 +1,322 @@
1
+ Metadata-Version: 2.4
2
+ Name: parley-consensus
3
+ Version: 0.2.0
4
+ Summary: Consensus among personal AI agents that faithfully represent owners with conflicting private interests — deterministic red-line enforcement + verifiable transcripts.
5
+ Project-URL: Homepage, https://parleyprotocol.com
6
+ Project-URL: Repository, https://github.com/5uper0/parley
7
+ Project-URL: Changelog, https://github.com/5uper0/parley/blob/main/CHANGELOG.md
8
+ Project-URL: Issues, https://github.com/5uper0/parley/issues
9
+ Keywords: ai-agents,multi-agent,consensus,negotiation,social-choice,max-min,red-lines,verifiable,tamper-evident,transcript,zero-dependency
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ License-File: NOTICE
26
+ Provides-Extra: crypto
27
+ Requires-Dist: pynacl>=1.6.2; extra == "crypto"
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=9.1.1; extra == "dev"
30
+ Requires-Dist: pynacl>=1.6.2; extra == "dev"
31
+ Requires-Dist: setuptools>=84.0.0; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ <div align="center">
35
+
36
+ # parley.
37
+
38
+ ### The trust layer for the agent economy
39
+
40
+ **Provable consensus for AI agents of rival owners**, deterministic red lines, max-min consensus over
41
+ masked verdicts, and a verifiable non-betrayal transcript.
42
+ <br>Multilateral (N&gt;2) · non-crypto · self-hosted · Apache-2.0.
43
+
44
+ [![ci](https://github.com/5uper0/parley/actions/workflows/ci.yml/badge.svg)](https://github.com/5uper0/parley/actions/workflows/ci.yml)
45
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
46
+ [![python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)
47
+ ![core](https://img.shields.io/badge/core-zero--dependency-informational.svg)
48
+ [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
49
+
50
+ **[Try it live](https://parleyprotocol.com/demo/)** · **[See it in 30 seconds](#see-it-in-30-seconds)** · [Roadmap](docs/ROADMAP.md) · [Changelog](CHANGELOG.md) · [Security](SECURITY.md) · [Contributing](CONTRIBUTING.md)
51
+
52
+ <br>
53
+
54
+ <img src="docs/brand/assets/parley-money-shot.gif" alt="Parley money-shot: three rival parties reach a max-min decision, a red-line-crossing shortcut is BLOCKED in code, and every party verifies a tamper-evident SHA-256 receipt" width="760">
55
+
56
+ <sub>Rival parties reach a max-min decision · a shortcut that would cheat someone is **BLOCKED** by a red line · every party verifies the tamper-evident receipt.</sub>
57
+
58
+ </div>
59
+
60
+ ---
61
+
62
+ ## Install
63
+
64
+ ```bash
65
+ pip install parley-consensus # zero-dependency core
66
+ pip install "parley-consensus[crypto]" # + Ed25519-signed verdicts (parley.net.identity, parley.net.bot)
67
+ ```
68
+
69
+ The distribution is `parley-consensus` (PyPI's `parley` is an unrelated project); the import name is `parley`.
70
+
71
+ ```python
72
+ from parley.agent import Agent
73
+ from parley.consensus import run_consensus
74
+ from parley.preferences import HardConstraint, PreferenceSheet
75
+
76
+ options = [{"venue": "rooftop", "cost": 900}, {"venue": "garden", "cost": 600}, {"venue": "diner", "cost": 300}]
77
+ ana = PreferenceSheet("Ana", utility=lambda o: 1.0 if o["venue"] == "rooftop" else 0.4)
78
+ bob = PreferenceSheet("Bob", hard=[HardConstraint("budget", lambda o: o["cost"] <= 700)], # a red line: code, not a preference
79
+ utility=lambda o: 1 - o["cost"] / 1000)
80
+ cara = PreferenceSheet("Cara", utility=lambda o: 0.9 if o["venue"] == "garden" else 0.5)
81
+
82
+ result = run_consensus([Agent(s.owner, s) for s in (ana, bob, cara)], options)
83
+ print(result.status, result.decision)
84
+ print("receipt sha256:", result.transcript.hash())
85
+ for sheet in (ana, bob, cara): # each owner replays their own private sheet, locally
86
+ print(sheet.owner, "not betrayed:", result.transcript.verify_non_betrayal(sheet, result.decision))
87
+ ```
88
+
89
+ ```
90
+ agreed {'venue': 'garden', 'cost': 600}
91
+ receipt sha256: a9cb75c0a15b41360fb2b134e084ca3b577daaf50f5edb657c5c4da43cc2fc72
92
+ Ana not betrayed: True
93
+ Bob not betrayed: True
94
+ Cara not betrayed: True
95
+ ```
96
+
97
+ The rooftop is Ana's favourite and loses anyway: it crosses Bob's budget red line, so it is rejected
98
+ before any score is weighed. The coordinator only ever saw `red-line`, never the budget or the sheet.
99
+
100
+ Contributors install from a clone instead: `pip install -e ".[dev]"` (see [Status](#status-v0-working-core)).
101
+
102
+ ### Use it from an MCP host (Claude, Cursor)
103
+
104
+ <!-- mcp-name: io.github.5uper0/parley -->
105
+
106
+ The base install ships a stdlib-only MCP server over stdio. Point your host at it:
107
+
108
+ ```json
109
+ {"mcpServers": {"parley": {"command": "parley-mcp"}}}
110
+ ```
111
+
112
+ If the console script is not on the host's `PATH`, launch it through the interpreter that has
113
+ the package: `{"command": "python", "args": ["-m", "parley.mcp"]}`.
114
+
115
+ Three tools appear: `parley_decide` (options + each party's red lines and preferences in,
116
+ `status`, `decision`, `transcript` and `transcript_sha256` out), `parley_verify_receipt`
117
+ (recompute the hash over a transcript, and recompute the max-min decision from its recorded
118
+ verdicts) and `parley_check_party` (replay one party's red lines against a decision). The input
119
+ is the same JSON as the recipes in [`examples/demo/`](examples/demo/). Example prompt:
120
+
121
+ > Three of us are picking a venue: rooftop (900), garden (600), diner (300). Bob will not go over
122
+ > 700; Ana prefers the rooftop, Cara the garden, Bob the cheapest. Use parley_decide, then verify
123
+ > the receipt hash and check that Bob's red line held.
124
+
125
+ **What this mode does and does not give you.** The host holds every party's spec and passes them
126
+ all in one call, so there is no privacy between parties or from the host. What still holds is
127
+ what the engine enforces in code: a red line rejects an option deterministically, the max-min
128
+ rule picks among options feasible for everyone, and the receipt hash makes any later edit to the
129
+ transcript visible, provided the hash is kept by someone other than whoever might edit the
130
+ transcript: it is unsigned and the server does not store it, so a hash and a transcript from the
131
+ same hand prove nothing about each other. `max_min_verified` does not depend on the hash: it
132
+ recomputes the winner from the recorded verdicts. For private sheets, run one process per owner over HTTP
133
+ ([`examples/run_env.py`](examples/run_env.py)); the coordinator then sees only masked verdicts.
134
+
135
+ ---
136
+
137
+ Most agent tooling in 2026 solves either transport/identity (A2A, MCP) or 1:1 agentic
138
+ commerce (an agent buys/books for you), or *cooperative* debate between agents of the
139
+ **same** owner. Parley targets the gap nobody productised: a group of delegates, each
140
+ representing a **different** principal with **conflicting** and **private** interests,
141
+ reaching a decision everyone can trust, and *prove* their agent didn't betray them.
142
+
143
+ **Who it's for.** Teams and platforms where several parties must reach a decision none of them can
144
+ rig, and prove it afterward. Built first for **regulated, multi-party workflows**: compliance &
145
+ onboarding decisions (KYC/AML, sanctions red lines), marketplace & P2P disputes, and delegated
146
+ governance (committees, panels).
147
+
148
+ The wedge is three properties, enforced in code rather than left to an LLM's discretion:
149
+
150
+ 1. **Deterministic red lines.** Each owner's hard constraints are predicates checked in
151
+ code. A proposal that crosses one is *rejected*, never negotiated away. "My agent
152
+ won't betray me" becomes a provable property, not a hope.
153
+ 2. **Conflicting-interest consensus.** The coordinator sees only masked verdicts, a
154
+ feasibility flag, a soft score, and a *masked* reason (`ok`/`red-line`), never the
155
+ private sheets or which constraint was at stake. A decision must be feasible for *every* agent; among those it
156
+ picks by an egalitarian max-min rule (lift the least-happy participant), tie-broken by
157
+ total welfare, social choice, not majority vote. No feasible option ⇒ honest deadlock.
158
+ 3. **Verifiable transcript.** A tamper-evident SHA-256 record of every masked verdict.
159
+ Each owner can replay their *own* private sheet locally to prove no red line was
160
+ crossed, without revealing the sheet to anyone.
161
+
162
+ ## Why this exists (and what we learned building it)
163
+
164
+ Agents are starting to act on our behalf: booking, negotiating, onboarding, allocating. The moment
165
+ two agents serve **different** owners, "did my agent sell me out?" stops being paranoia and becomes a
166
+ real question. The crypto answer to agent-trust (put it on a chain, add a token) collapsed 89–99.7%;
167
+ the durable need is the **trust primitive itself**, decoupled from tokens.
168
+
169
+ > **AI that can't lie, and you can check.** The 2026 agent-hype cycle proved virality can be
170
+ > fully decoupled from truth. Parley is the provable version: every verdict in a parley is a
171
+ > re-hashable receipt, and each owner replays their own private sheet to prove no red line was
172
+ > crossed, no trust required, just the check.
173
+
174
+ Building the v0 taught us the wedge is narrower and sharper than "multi-agent consensus": the value
175
+ isn't the vote, voting is free (Snapshot, polls). The value is **provable non-betrayal under
176
+ conflicting private interests**, that no party had to reveal their private sheet or which red line
177
+ was at stake, no red line could be traded away, and everyone can check the receipt themselves. That's what doesn't compose from off-the-shelf
178
+ parts, and it's the one thing we made enforceable in code rather than left to an LLM's goodwill. The
179
+ worked proof: [`docs/dogfood-01-p2p-escrow.md`](docs/dogfood-01-p2p-escrow.md).
180
+
181
+ ## Status: v0 (working core)
182
+
183
+ Pure-stdlib, zero-dependency core. In-process transport with a clean seam where **A2A**
184
+ (distributed discovery + signed Agent Cards) and **LLM-elicited preference sheets** drop
185
+ in next. This v0 deliberately isolates the novel part, the consensus + non-betrayal,
186
+ and reuses nothing that's already a commodity.
187
+
188
+ ```bash
189
+ python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"
190
+ .venv/bin/pytest -q # the full suite, all green
191
+ .venv/bin/python examples/demo/server.py # the money-shot: open http://127.0.0.1:8080 → Run
192
+ .venv/bin/python examples/meeting.py # three delegates pick a meeting slot
193
+ .venv/bin/python examples/run_env.py # bots as separate processes, consensus over HTTP
194
+ .venv/bin/python examples/real_decision.py --options examples/demo/recipe_committee.json
195
+ # run a real decision with real people, each one ratifies
196
+ ```
197
+
198
+ ### See it in 30 seconds
199
+
200
+ `examples/demo/server.py` runs the *real* engine behind one web page:
201
+ rival parties, a max-min decision, one option **BLOCKED** by a red line, and a re-hashable receipt
202
+ each party verifies privately. A worked example, a P2P escrow dispute end-to-end, with the
203
+ per-party "this is better because…", is in [`docs/dogfood-01-p2p-escrow.md`](docs/dogfood-01-p2p-escrow.md)
204
+ (synthetic). A **real, anonymized** dispute, a retrospective early-lease-exit replay where the tenant
205
+ ratified a "this would have been better" outcome, is in
206
+ [`docs/dogfood-02-early-lease-exit.md`](docs/dogfood-02-early-lease-exit.md) (honest boundary: the
207
+ landlord side is inferred, not ratified). The screenshot-native proof card is `examples/demo/proofcard_p2p.html`.
208
+
209
+ **No Python? Run the demo with Docker:**
210
+
211
+ ```bash
212
+ docker build -t parley . && docker run --rm -p 8080:8080 parley # open http://127.0.0.1:8080
213
+ ```
214
+
215
+ **Try it live: [parleyprotocol.com/demo](https://parleyprotocol.com/demo/)** runs the real engine
216
+ behind one web page, no install and nothing to sign up for. Prefer to self-host? The repo ships a
217
+ `Dockerfile` (and a `render.yaml` Blueprint) so you can run the same demo anywhere in one command.
218
+
219
+ ## Built by an agent fleet
220
+
221
+ The product is **trust between agents of different owners**. It was *made* by a fleet of one owner's
222
+ agents: they plan, write the code, review each other, and ship behind a hard gate, a human directs
223
+ and holds the irreversible gates (going public, outreach), the fleet does the engineering. Every
224
+ change clears the same gate you can run yourself: `scripts/ship-gate.sh`, tests green,
225
+ zero-dependency core, examples run, under conventional-commit discipline.
226
+
227
+ ## Security (v0.1)
228
+
229
+ The net layer is hardened against the obvious attacks (see `tests/test_redteam.py`):
230
+
231
+ - **Signed verdicts (Ed25519).** Each bot signs its verdict over the specific option, binding the
232
+ content to a key. `verify_transcript(require_signed=True)` then rejects any verdict that was
233
+ altered, or that arrives unsigned when a signature was expected. **Scope (read this):** the check
234
+ proves each signature is internally consistent with the pubkey *carried in that record*. It does
235
+ **not** yet prove *authenticity*, that the pubkey is the owner's real key, because there is no
236
+ trusted `owner → key` roster: a coordinator that assembles the transcript could substitute its own
237
+ keypair. Treat signatures today as **tamper-evidence**, not third-party-provable identity.
238
+ - **Auth + rate limiting + input validation.** Without a bearer token `/consider` returns 401;
239
+ brute-force enumeration is throttled (429); oversized/malformed bodies are rejected (413/400).
240
+ This closes the preference-extraction hole (an unauthenticated attacker previously reconstructed
241
+ a bot's private red line by probing).
242
+ - **Outcome verification.** `verify_outcome(transcript)` (in `parley.consensus`) recomputes the
243
+ max-min winner from the recorded verdicts and checks it matches the announced decision, so a
244
+ coordinator that finalizes a *feasible-but-not-max-min* (or infeasible) option is caught. Anyone
245
+ can replay it over the public record — no private sheet needed. Pass
246
+ `expected_owners=` the roster you expect, or a coordinator that drops one owner from every entry
247
+ still passes. (`verify_non_betrayal` still only proves your *own* red lines held.)
248
+
249
+ Not yet (v0.1 honest limits, do not treat as production-secure for adversarial principals):
250
+ - **Authenticity pinning**, signatures verify against a self-asserted key, not a trusted roster
251
+ (above); the roster-pinned check (verify against the key from each bot's discovery Agent Card) is v0.2.
252
+ Today only the coordinator's own side pins it: the client checks that a signature is present
253
+ under the card's key; whether the signature is valid is checked by
254
+ `verify_transcript(require_signed=True)`, which `examples/run_env.py` now runs and any other
255
+ caller must run.
256
+ - **Replay binding**, verdicts carry no session/nonce, so a signed verdict is replayable into another
257
+ parley that reuses the same option.
258
+ - **Range-masked scores**, the soft cardinal `score` is public in the transcript, so an untrusted
259
+ coordinator can infer preference *ordering* and each party's feasible region (the *reason* and the
260
+ private sheet stay hidden; MPC/range-masking is future work).
261
+ - **TLS/mTLS**, and game-theoretic **collusion / strategic-misreport resistance** (the research track).
262
+
263
+ The hosted demo at [parleyprotocol.com](https://parleyprotocol.com) uses GA4 for basic traffic
264
+ analytics — see [what's collected](https://parleyprotocol.com/privacy). The protocol and the
265
+ self-hosted `docker run` path collect nothing.
266
+
267
+ ## Where's the money (open-core thesis)
268
+
269
+ The consensus mechanism itself is a commodity (voting/consensus is free, Snapshot, polls). Value,
270
+ and willingness to pay, scales with **decision stakes × number of parties × need for privacy /
271
+ neutrality / audit**. The paid layer is the *trusted neutral broker*: hosted identity/trust-registry,
272
+ audit-grade signed transcripts, and managed self-hosting, not the algorithm. First candidate
273
+ segments: private multi-party B2B negotiation (procurement/SOW) and auditable delegated governance
274
+ (committees, panels). Differentiator vs **Fetch.ai / Olas** (real prior art): they do *bilateral*
275
+ commerce on a *blockchain*; Parley does *multilateral group consensus*, provable non-betrayal,
276
+ **no crypto**, self-hosted.
277
+
278
+ The demo shows three people whose agents hold private, conflicting constraints reach a
279
+ slot everyone's red lines allow, then each owner proves non-betrayal, and a second run
280
+ that hits an honest deadlock instead of forcing a bad decision.
281
+
282
+ ## Architecture
283
+
284
+ | Layer | v0 | Next |
285
+ |-------|----|------|
286
+ | Transport / discovery / identity | in-process | **A2A** (signed Agent Cards, mDNS/registry), *reuse, don't rebuild* |
287
+ | Agent brain | pure code | Claude or local model elicits the preference sheet |
288
+ | **Red-line enforcement** | `parley/preferences.py` (code predicates) | the core; stays deterministic |
289
+ | **Consensus** | `parley/consensus.py` (max-min) | Nash bargaining, weighted rules |
290
+ | **Verifiability** | `parley/transcript.py` (hash + local replay) | signed transcripts; range-masked scores (MPC) |
291
+ | Adversarial | N/A | **Byzantine/collusion resistance**, the research-grade contribution |
292
+
293
+ ## Roadmap → open-core
294
+
295
+ - **Now:** consensus core + red-line guard + verifiable transcript (this repo, Apache-2.0).
296
+ - **Next:** A2A transport so agents on different machines discover and parley over a LAN;
297
+ LLM-elicited sheets; signed transcripts.
298
+ - **Research:** inject a lying/colluding agent and show max-min + Byzantine-robust
299
+ aggregation resists it. This is the part potentially interesting to frontier R&D.
300
+ - **Paid (self-host):** hosted relay/trust-registry so agents meet safely beyond the LAN,
301
+ plus managed hosting of agents on your own hardware. Open-source core, paid federation.
302
+
303
+ First ICP: a **closed group** (a team/department/family) where one operator deploys all
304
+ the agents, sidesteps the cold-start network effect. "Delegate the position to your
305
+ agent, agents find the common decision" is exactly this.
306
+
307
+ ## Contributing
308
+
309
+ The core is small on purpose; the best contributions right now are **adversarial tests** and a
310
+ second opinion on the consensus protocol. Start with [CONTRIBUTING.md](CONTRIBUTING.md), file a bug
311
+ with a reproducing recipe, or open a discussion. Report security issues privately via
312
+ [SECURITY.md](SECURITY.md).
313
+
314
+ ## Star history
315
+
316
+ If Parley's approach to provable non-betrayal is interesting, a star helps others find it.
317
+
318
+ <!-- Renders once the repo is public: -->
319
+ [![Star History Chart](https://api.star-history.com/svg?repos=5uper0/parley&type=Date)](https://star-history.com/#5uper0/parley&Date)
320
+
321
+ ## License
322
+ Apache-2.0, permissive, with an explicit patent grant (clears enterprise legal review). See [LICENSE](LICENSE) + [NOTICE](NOTICE).