decide

package
v2.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package decide is the port through which the engine asks typed questions of a piece of text: which of these options it is, or whether a statement holds of it, each answer a calibrated probability (docs/adr/0023). It reads; it never writes text. The engine uses it to check what a person wrote against the discipline's examples and to recognise what a person means, and works without it: a deployment that chooses none gets every check and every answer it had before.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnavailable = errors.New("decisions unavailable")

ErrUnavailable is a decider that cannot answer now (its model not reachable). The engine answers as it would without one.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	// Choice is the option picked, for a Choice, and Probabilities every
	// option's probability.
	Choice        string
	Probabilities map[string]float64
	// Yes is the probability the statement holds, for a YesNo.
	Yes float64
}

Answer is one question's answer.

type Decider

type Decider interface {
	// Decide answers every question asked of state, by the question's
	// name, in one call.
	Decide(ctx context.Context, state string, questions map[string]Question) (map[string]Answer, error)
	// Ready reports whether the model would answer now: nil when it is
	// loaded and reachable, ErrUnavailable when it is not. Callers that
	// can choose a way of working (an agent over MCP) ask it first.
	Ready(ctx context.Context) error
}

Decider answers questions about a text.

type Option

type Option struct {
	Key, Description string
}

Option is one answer a Choice may pick: a key, and a description of what it means, which is what the decision is made against.

type Question

type Question struct {
	Type Type
	// Instructions say what to decide, in a sentence.
	Instructions string
	// Options are a Choice's answers, in the order they are put; a
	// decider keeps the order, which a model may read. A YesNo has none.
	Options []Option
}

Question is one thing to decide about the text.

type Type

type Type string

Type is the kind of answer a question wants.

const (
	// Choice picks one of the options.
	Choice Type = "choice"
	// YesNo says how likely a statement about the text is to hold.
	YesNo Type = "yesno"
)

Directories

Path Synopsis
Package conformance is what every decide.Decider must do: answer every question asked, pick a Choice from its own options with probabilities that are probabilities, give a YesNo a probability, and stop when its context is cancelled.
Package conformance is what every decide.Decider must do: answer every question asked, pick a Choice from its own options with probabilities that are probabilities, give a YesNo a probability, and stop when its context is cancelled.
Package fake is a decide.Decider for the gate's tests: it answers each question as a test scripts it, by the question's name, and any question not scripted as a model unsure of it would (every option alike, a yes or no at one half).
Package fake is a decide.Decider for the gate's tests: it answers each question as a test scripts it, by the question's name, and any question not scripted as a model unsure of it would (every option alike, a yes or no at one half).
Package laya is a Decider backed by Laya, an open decision model, run as a sidecar beside Cartograph (deploy/laya): the model needs a runtime the static binary does not carry, so it is reached over HTTP on the same host or network.
Package laya is a Decider backed by Laya, an open decision model, run as a sidecar beside Cartograph (deploy/laya): the model needs a runtime the static binary does not carry, so it is reached over HTTP on the same host or network.

Jump to

Keyboard shortcuts

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