regressiongate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package regressiongate demonstrates LoopKit's quality engine: fixture replay assertions and eval suite with regression gate.

Workflow:

  1. Run the loop with real data to record a fixture: fixture.Record(...)
  2. Commit the fixture to version control.
  3. In CI, run gate_test.go to assert the loop still behaves correctly.

Example gate test:

result := looptest.Replay(t, def, "fixtures/greeting.loopfix")
result.AssertCompleted(t)

eval.RunSuite(t, suite, eval.Gate{
    MinMean: 0.8,
    MaxRegression: 0.05,
    Baseline: "evals/baseline.json",
})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Definition

func Definition() loop.Definition[State, Result]

Definition builds the greeting loop definition. The loop calls a "greet" tool once and finishes with the result.

Iteration pattern:

  • Iteration 1 (Greeted=false): emit ToolCall("greet")
  • ToolCalled handler: store greeting in state, set Greeted=true (actions from ToolCalled handler are discarded by the runner, but state mutations ARE preserved)
  • Iteration 2 (Greeted=true): emit Finish with stored greeting

Types

type Result

type Result struct {
	// Greeting is the produced greeting message.
	Greeting string `json:"greeting"`
}

Result is the output produced when the loop finishes.

type State

type State struct {
	// Name is the input name to greet.
	Name string `json:"name"`
	// Greeted tracks whether we've received the tool result.
	Greeted bool `json:"greeted"`
	// Greeting holds the produced greeting after the tool call.
	Greeting string `json:"greeting"`
}

State is the loop state for the greeting example.

Jump to

Keyboard shortcuts

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