stub

package
v0.2.7 Latest Latest
Warning

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

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

Documentation

Overview

Package stub is the brain that needs no model: it answers every decision with the same canned proposal, so the harness runs and its specs pass with no inference provider, network or credential at all.

Index

Constants

View Source
const ProviderName = "stub"

ProviderName is the Provider every canned proposal carries.

Variables

This section is empty.

Functions

This section is empty.

Types

type CannedBrain

type CannedBrain[Context any, Action any] struct {
	// contains filtered or unexported fields
}

CannedBrain proposes the same actions, in the same order, for every decision. It is deterministic and immutable after construction, so one value is safe to share between goroutines.

func NewCannedBrain

func NewCannedBrain[Context any, Action any](actions ...Action) *CannedBrain[Context, Action]

NewCannedBrain returns a brain that proposes actions for every decision. With no actions it answers model.ErrNoProposal, which is how a spec drives a consumer's empty-proposal path.

func (*CannedBrain[Context, Action]) Propose

func (brain *CannedBrain[Context, Action]) Propose(ctx context.Context, decision Context) (*model.Proposal[Action], error)

Propose returns a fresh copy of the canned actions. It ignores decision by design: the stub stands in for reasoning, it does not perform any.

Jump to

Keyboard shortcuts

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