Package chaos
Go module github.com/bide-ai/bide; all packages.
github.com/bide-ai/bide/chaos · pkg.go.dev · Stability: experimental
Package chaos is a deterministic crash-injection benchmark for agent runtimes: it drives a NON-IDEMPOTENT side effect through a fault schedule and checks it fires at most once.
type Report
go
type Report struct {
Name string
Sweeps int
Schedules int
MaxFired int
Violations int
Missed int
}Report is the outcome of a chaos run against one System.
Constructors and functions
func Verify(name string, sys System, seeds int) Report: Verify runs one crash-free run, an exhaustive crash-point sweep, andseedsrandomized multi-crash schedules against sys, and returns a Report.
Methods
func (r Report) OK() bool: OK reports whether the side effect fired at most once on every schedule and exactly once on every run that reached a terminal state.func (r Report) String() string: String formats the report as one line: the name, the sweep and schedule counts, the worst fire count, and a PASS or FAIL verdict.
type Run
go
type Run interface {
Step(crashAt int) (crashed bool)
Fired() int
}Run is one scenario instance: a fresh store + zeroed side-effect counter.
type System
go
type System interface {
NewRun() Run
Writes() int
}System is one SDK under test: it builds fresh Runs and reports the number of durable writes in a clean run (the crash-sweep upper bound).
Constructors and functions
func Bide() System: Bide is the reference System: Bide' durable loop wired to charge once.func NaiveReference() System: NaiveReference is a deliberately-simple at-least-once loop: it journals tool results and replays them, but a tool whose result isn't journaled is simply RE-RUN, no attempt marker, no halt-on-unknown-outcome.