--- name: chainaim-agent-negotiation-certifier description: Full audit of a multi-attribute negotiation — every buyer/seller pair, all four negotiation verdicts, and each deal's frontier position and pareto-distance — as one re-checkable, hash-anchored certificate. 4-attribute (2- and 3-attribute are roadmap). --- # ChainAIM Agent Negotiation Certifier Runs a multi-attribute negotiation between buyer and seller agents and emits a deterministic "best-deal" certificate: for each agreed pair, the settled deal, both parties' utilities, and whether the settlement is on the feasible Pareto frontier — plus four negotiation verdicts. The certificate's `provenance.trace_sha256` doubles as the settlement `task_id`, so the deal can be handed to a settlement service downstream. ## Base URL https://chainaim-negotiation-services-production.up.railway.app ## Endpoints GET /health Liveness check. Response: {"status":"ok","service":"chainaim-agent-negotiation-certifier"} GET /demo/negotiation?attrs=4 Describes the server-side scenario that will run (all data is server-side). Example: curl "https://chainaim-negotiation-services-production.up.railway.app/demo/negotiation?attrs=4" POST /certify Runs the negotiation and returns the certificate. Body: {"attrs": 4} Example: curl -s -X POST https://chainaim-negotiation-services-production.up.railway.app/certify -H "Content-Type: application/json" -d '{"attrs":4}' Response (shape): {"certificate": {...}, "certificate_json": "...", "signature": null, "cert_trust": "hash-only", "task_id": "", "display": "=== Negotiation Best-Deal Certificate ===\n..."} GET /cert/{task_id} Fetch a previously built certificate by its task_id (== provenance.trace_sha256). Example: curl "https://chainaim-negotiation-services-production.up.railway.app/cert/" ## How the agent should use this 1. Call POST /certify with body {"attrs": 4}. 2. Print the `display` field from the response verbatim — it is the human-readable certificate. 3. The value printed after "task_id (for settlement):" is the handle to give the settlement skill. 4. Then print the short "Reading it" block below for the FIRST pair only, filling its values from `certificate.pairs[0]` (deal, nash_point, nash_distance, on_frontier, pareto_distance) — the last three are in the JSON but not in `display`. ## Output format (print exactly this, filling <...> from the /certify response) === ChainAIM Negotiation Certificate === Reading it (first pair, from certificate.pairs[0] — p/d/n/q are negotiated tiers, not dollars: p=price band, d=delivery window, n=volume/MOQ band, q=quality grade): Agreed deal: what the two agents settled on Fair-optimal: the balanced Nash reference deal How far apart: (0 = same as the fair-optimal) Best available? on_frontier= pareto_distance= (true / 0.0 = nothing beats it) === END — this deal is certified on the feasible Pareto frontier ===