decision

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package decision defines the Decision record: every non-trivial choice the agent makes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Type          QuestionType       `json:"type"`
	Refused       bool               `json:"refused,omitempty"`
	Probability   float64            `json:"probability,omitempty"` // predicate: chance the statement is true
	Choice        string             `json:"choice,omitempty"`
	Score         float64            `json:"score,omitempty"` // score: probability-weighted level index
	Probabilities map[string]float64 `json:"probabilities,omitempty"`
	Confidence    float64            `json:"confidence,omitempty"` // choice and score only
}

func (Answer) MarshalJSON

func (a Answer) MarshalJSON() ([]byte, error)

MarshalJSON writes the fields that belong to the answer's type, keeping zeros: a predicate at probability 0 is an answer, not a missing value.

type Decision

type Decision struct {
	ID        ulid.ULID
	ParentID  *ulid.ULID
	At        time.Time
	PerceptID ulid.ULID
	SetID     string // question set or reflex that decided, e.g. "incoming_message@3"
	Tier      Tier
	Provider  string // "" for reflexes
	Answers   map[string]Answer
	Action    string
	Reply     string // what was said, on the decision that said it; "" otherwise
	Gate      Gate
	Latency   time.Duration
	CostUSD   float64
	Outcome   *Outcome
	Affect    json.RawMessage // nil until emotions exist (architecture §4.9)
}

type Gate

type Gate string

Gate is what the autonomy policy did with the chosen action.

const (
	GateAuto   Gate = "auto"
	GateAsked  Gate = "asked"
	GateDenied Gate = "denied"
)

type Outcome

type Outcome struct {
	Status OutcomeStatus `json:"status"`
	Detail string        `json:"detail,omitempty"`
	At     time.Time     `json:"at"`
}

type OutcomeStatus

type OutcomeStatus string
const (
	OutcomeOK     OutcomeStatus = "ok"
	OutcomeFailed OutcomeStatus = "failed"
)

type QuestionType

type QuestionType string
const (
	QuestionPredicate QuestionType = "predicate"
	QuestionChoice    QuestionType = "choice"
	QuestionScore     QuestionType = "score"
)

type Tier

type Tier string
const (
	TierReflex  Tier = "reflex"
	TierSystem1 Tier = "system1"
	TierSystem2 Tier = "system2"
)

Directories

Path Synopsis
Package questions loads question sets: versioned System 1 questions plus the thresholds the router uses, kept as data in decisions/*.yaml.
Package questions loads question sets: versioned System 1 questions plus the thresholds the router uses, kept as data in decisions/*.yaml.

Jump to

Keyboard shortcuts

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