Parley

v0.2.0
io.github.5uper0/parley Checked 3 days ago Published 2 months ago

Multi-party decisions for agents: red lines rejected in code, max-min pick, SHA-256 receipt.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

parley_decide

Reach a decision among parties with conflicting interests. Give the options and each party's red lines (hard constraints, checked in code) and soft preferences. An option that crosses any party's red line is rejected outright; among the options acceptable to everyone the max-min rule picks the one whose least-satisfied party is best off, tie-broken by total score. No option acceptable to all parties yields an honest status 'deadlock' with decision null, never a forced choice. Returns JSON: status ('agreed'|'deadlock'), decision (the winning option object or null), transcript (every option with…

ParameterTypeDescription
spec *objectA DecisionSpec: the shared options plus every party's position, the same JSON as examples/demo/recipe_*.json. Extra keys are ignored.
rulestringSelection rule. Only 'egalitarian' (max-min) exists.

parley_verify_receipt

Two independent checks on a transcript from parley_decide. Returns JSON: match, max_min_verified, expected_sha256, recomputed_sha256. match=true means only that this transcript hashes to the sha256 you passed. The hash is unsigned and this server does not store it, so if the transcript and the hash come from the same party, match proves nothing: whoever edits the record can re-hash it. It detects tampering only when the hash was kept by someone other than whoever could edit the transcript. max_min_verified recomputes the decision from the recorded verdicts: true when the announced result is ex…

ParameterTypeDescription
sha256 *stringThe transcript_sha256 you were given, hex.
transcript *objectThe `transcript` object returned by parley_decide, unmodified.
expected_ownersarrayOptional. The owners you know took part; every entry must carry exactly this set for max_min_verified to be true.

parley_check_party

Replay one party's red lines against a decision: did the outcome cross any of them? Pass the party's spec (the same object you would put in parley_decide's parties) and the decision object returned by parley_decide. Returns JSON: owner and holds (true when every red line of that party holds on the decision). A null decision (deadlock) forces nothing on anyone, so holds is true. Soft preferences are not judged here, only red lines.

ParameterTypeDescription
decision *object | nullThe decision from parley_decide, or null for a deadlock.
party *objectOne party: a distinct owner name, hard red lines, soft utility terms.