Help us shape the future of Go! Take the 2026 Go Developer Survey

durabletest

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package durabletest checks that an implementation satisfies the agent.Durable contract's fidelity guarantee, so every store (in-memory, SQLite, Postgres, or your own) is held to the property the agent loop's resume relies on: the record Do returns on the live path is exactly the record a replay reads back, for any content a model or tool can produce.

A store that returned the caller's own record live but a decoded copy on replay would let a resumed run rebuild a different conversation than the one it was having, so the model would read different bytes after a crash than without one. The suite feeds the store records whose encoding is easy to get wrong (HTML-significant characters, insignificant whitespace, U+2028, NUL, invalid UTF-8, unusual number forms, key order) and requires the live record, the memoized record, and the History record to be identical and in the journal's canonical form (agent.EncodeRecord).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, open func(t *testing.T) agent.Durable)

Run runs the fidelity suite. open returns a handle on the store under test; run IDs are unique per call, so the suite can run repeatedly against a persistent backend.

Types

type Case

type Case struct {
	Name   string
	Record agent.Record
	Want   json.RawMessage
}

Case is one record the suite round-trips. Want, when set, is the Result the store must hand back: the record's canonical form, which is the tool's JSON with insignificant whitespace removed and every other byte kept.

func Cases

func Cases() []Case

Cases returns the records the suite round-trips, for stores that want to run further checks (such as comparing the bytes they persisted) on the same inputs.

Jump to

Keyboard shortcuts

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