gemotclient

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gemotclient is a thin MCP client for a gemot deliberation service (github.com/justinstimatze/gemot). It drives the deliberation primitive ettle's collective layer needs: agents submit positions, gemot extracts cruxes with a controversy score, and proposes a binding compromise. (gemot also exposes EigenTrust reputation; ettle doesn't consume it yet.)

Bring up a local gemot with the one-command dev stack in deploy/ (NATS + gemot in demo mode — in-memory, no Postgres, no auth) and run ettle against it with --insecure-local. See deploy/README.md. A persistent, authenticated gemot (Postgres + GEMOT_REQUIRE_AUTH=1 + a per-agent bearer token) is the real deployment shape — see SECURITY.md and gemot's docs/private-deployment.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps an MCP session to a local gemot server.

func Connect

func Connect(ctx context.Context, endpoint, token string, insecureLocal bool) (*Client, error)

Connect dials gemot's MCP endpoint. A bearer token is REQUIRED off localhost, and the endpoint must be https:// when a token is sent (TLS terminated at gemot or a proxy) — the crux is the most sensitive payload on the wire and a bearer over plaintext leaks. The token is sent as `Authorization: Bearer` on every call. The only tokenless path is explicit: insecureLocal=true AND a loopback endpoint, for dev against gemot's anonymous sandbox.

"loopback" is resolved, not string-matched (see internal/loopback): a hostname that resolves off-box is rejected even if it's named to look local. After connecting with a token, the session is checked to be non-anonymous (gemot degrades a bad/expired token to an anonymous sandbox rather than rejecting it unless GEMOT_REQUIRE_AUTH=1) — a detected anonymous session is a loud error, not a silent plaintext-grade run.

func (*Client) Close

func (c *Client) Close()

func (*Client) Create

func (c *Client) Create(topic, description string) (string, error)

Create makes a deliberation and returns its id.

func (*Client) PollResult

func (c *Client) PollResult(delibID string, timeout time.Duration) (string, error)

PollResult waits for the analysis result (raw JSON), tolerating "not ready" errors.

func (*Client) ProposeCompromise

func (c *Client) ProposeCompromise(delibID string) string

ProposeCompromise asks gemot for a binding compromise (raw JSON).

func (*Client) RunAnalysis

func (c *Client) RunAnalysis(delibID string) error

RunAnalysis triggers gemot's (async) crux extraction.

func (*Client) SubmitPosition

func (c *Client) SubmitPosition(delibID, agentID, content, interests, reservation string) error

SubmitPosition adds one agent's position. Only the typed position crosses — never the agent's raw private reasoning.

type Compromise

type Compromise struct {
	Crux      string
	Proposal  string
	Rationale string
}

Compromise is a proposed binding resolution.

func Compromises

func Compromises(raw string) []Compromise

Compromises parses propose_compromise output (array form or single-object form).

type Crux

type Crux struct {
	Claim       string
	Controversy float64
}

Crux is one extracted point of contention. Controversy in [0,1]. (gemot returns more fields — explanation, type, agree/disagree rosters — which ettle doesn't consume yet; parse them when a caller needs them.)

func Cruxes

func Cruxes(raw string) []Crux

Cruxes parses the analysis result JSON.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL