Versions in this module Expand all Collapse all v1 v1.0.3 Oct 15, 2026 v1.0.2 Oct 14, 2026 v1.0.1 Oct 14, 2026 v1.0.0 Oct 14, 2026 Changes in this version + func InfraReason(res *agent.Result) string + func OverBudget(cost, limit float64) bool + func PauseUntil(now, resets time.Time, backoff, maxPause time.Duration) time.Time + func RateLimitedText(msg string) bool + func SelectProfile(p agent.Profile, n int) (agent.Profile, bool) + func Sleep(ctx context.Context, delay time.Duration) error + func Spend(entries []LedgerEntry, key work.Key, since time.Time) (cost float64, sessions, unknown int) + type BudgetSignal struct + Crossed bool + Reached bool + Released bool + Resume float64 + Spent float64 + Unknown int + func EvaluateWindow(entries []LedgerEntry, now time.Time, window time.Duration, ...) BudgetSignal + type Bus struct + func NewBus(buffer int, now func() time.Time) *Bus + func (b *Bus) Publish(ev Event) + func (b *Bus) Subscribe() <-chan Event + type CapacityPause struct + func (p *CapacityPause) Check(now time.Time) (paused, released bool) + func (p *CapacityPause) Extend(now, until time.Time) (time.Time, bool) + func (p *CapacityPause) Until() time.Time + type Degraded struct + func (d *Degraded) Record(name string, failed bool, message string, now time.Time, threshold int) (OpFailure, bool) + func (d *Degraded) Snapshot() []OpFailure + type Event struct + Activity string + Completed int + CostKnown bool + CostUSD float64 + Dir string + Duration time.Duration + Err string + Fallback bool + Kind string + Model string + Note string + Outcome string + Phase string + Role string + Round int + Sandbox string + Session string + Stage string + Started time.Time + Success bool + Time time.Time + Total int + Turns int + Work work.Ref + type FailureKind int + const FailureBehavioural + const FailureInfra + const FailureNone + func ClassifyFailure(res *agent.Result) FailureKind + func (k FailureKind) String() string + type Ledger struct + Dir string + Now func() time.Time + func NewLedger(dir string) *Ledger + func (s *Ledger) AppendLedger(e LedgerEntry) error + func (s *Ledger) LedgerPath() string + func (s *Ledger) ReadLedger(since time.Time) ([]LedgerEntry, error) + func (s *Ledger) TrimLedger(before time.Time) (int, error) + type LedgerEntry struct + CostUSD float64 + CostUnknown bool + DurationMS int64 + ErrorSubtype string + Outcome string + Role string + Session string + Time time.Time + TimedOut bool + Turns int + Work work.Ref + type LedgerLineError struct + Err error + Line int + Path string + func (e *LedgerLineError) Error() string + func (e *LedgerLineError) Unwrap() error + type Member struct + func (m *Member) Acquire(n int) bool + func (m *Member) Leave() + func (m *Member) Pass() + func (m *Member) Pool() *SharedPool + func (m *Member) Release(n int) + type OpFailure struct + Count int + Escalated bool + First time.Time + Last time.Time + LastError string + Op string + type RetryDecision struct + Delay time.Duration + Retry bool + UseFallback bool + type RetryPolicy struct + Delay time.Duration + Retries int + WithFallback bool + func (p RetryPolicy) Decide(attempt int, retryable bool) RetryDecision + type SharedPool struct + func NewSharedPool(size int) *SharedPool + func (p *SharedPool) InUse() int + func (p *SharedPool) Join(name string, wake func()) *Member + func (p *SharedPool) Size() int + func (p *SharedPool) Waiting() []string + type Streaks struct + func (s *Streaks[K]) Record(key K, crossed bool) int + type Wake chan struct + func NewWake() Wake + func (w Wake) Drain() + func (w Wake) Signal() + func (w Wake) Wait(ctx context.Context, tick <-chan time.Time, local func()) bool