decision

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 2 Imported by: ? 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 is the layer the graph exists for: what an agent knew, what it chose, under which rule, and what followed. It is named for the act rather than the data because the data is already the graph.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cause

type Cause interface {
	Chain(ctx context.Context, id string) ([]Record, error)
}

Cause walks the chain: which earlier decisions this one rests on.

type Policy

type Policy interface {
	Allow(ctx context.Context, agent, choice string) (bool, string)
}

Policy says whether a choice is allowed. It answers before the act, so a refusal is a decision with a reason rather than an error.

type Record

type Record struct {
	ID      string
	Agent   string
	Choice  string
	Because []string // Triple or Entity ids that supported the choice
	Rule    string   // the Policy that allowed it
	At      time.Time
}

Record is one decision an agent made and the evidence it stood on.

type Recorder

type Recorder interface {
	Record(ctx context.Context, r Record) error
	By(ctx context.Context, agent string) ([]Record, error)
}

Recorder keeps decisions and can read them back by agent.

Jump to

Keyboard shortcuts

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