ledger

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerdictAdmit   = "admit"
	VerdictRefuse  = "refuse"
	VerdictDegrade = "degrade"
	ReasonFit      = "budget_fit"
	ReasonOverflow = "required_overflow"
	ReasonDropped  = "optional_dropped"
	ReasonAnchors  = "anchors_lost"
)

Variables

This section is empty.

Functions

func Emit

func Emit(root string, decision Decision)

Types

type Decision

type Decision struct {
	Verdict          string         `json:"verdict"`
	Reason           string         `json:"reason"`
	BudgetBytes      int64          `json:"budget_bytes"`
	RequestedBytes   int64          `json:"requested_bytes"`
	RemainingBytes   int64          `json:"remaining_bytes"`
	RequiredOverflow bool           `json:"required_overflow"`
	DroppedOptional  int            `json:"dropped_optional,omitempty"`
	ItemsRequired    int            `json:"items_required"`
	ItemsIncluded    int            `json:"items_included"`
	CoverageBPS      int            `json:"coverage_bps"`
	ToolCalls        int            `json:"tool_calls"`
	Included         []ctxpack.Item `json:"included,omitempty"`
}

func Decide

func Decide(budget int64, pack ctxpack.Pack, dispatch Dispatcher) Decision

type Dispatcher

type Dispatcher func()

Jump to

Keyboard shortcuts

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