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 ¶
- type Client
- func (c *Client) Close()
- func (c *Client) Create(topic, description string) (string, error)
- func (c *Client) PollResult(delibID string, timeout time.Duration) (string, error)
- func (c *Client) ProposeCompromise(delibID string) string
- func (c *Client) RunAnalysis(delibID string) error
- func (c *Client) SubmitPosition(delibID, agentID, content, interests, reservation string) error
- type Compromise
- type Crux
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 ¶
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) PollResult ¶
PollResult waits for the analysis result (raw JSON), tolerating "not ready" errors.
func (*Client) ProposeCompromise ¶
ProposeCompromise asks gemot for a binding compromise (raw JSON).
func (*Client) RunAnalysis ¶
RunAnalysis triggers gemot's (async) crux extraction.
func (*Client) SubmitPosition ¶
SubmitPosition adds one agent's position. Only the typed position crosses — never the agent's raw private reasoning.
type Compromise ¶
Compromise is a proposed binding resolution.
func Compromises ¶
func Compromises(raw string) []Compromise
Compromises parses propose_compromise output (array form or single-object form).