evalplan

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package evalplan defines immutable evaluation inputs and scorer identities.

Index

Constants

View Source
const SchemaVersion = 1

SchemaVersion is the supported frozen-plan wire version.

Variables

This section is empty.

Functions

func Encode

func Encode(ctx context.Context, p *Plan) ([]byte, error)

Encode validates a plan before crossing a store boundary.

Types

type Case

type Case struct {
	Case     testcase.Case `json:"case"`
	Criteria []Criterion   `json:"criteria"`
}

Case contains private scoring inputs and the exact criteria applied to them.

type Criterion

type Criterion struct {
	ID               string         `json:"id"`
	Scorer           string         `json:"scorer"`
	Revision         string         `json:"revision"`
	Config           map[string]any `json:"config,omitempty"`
	Required         bool           `json:"required"`
	RequiresExpected bool           `json:"requires_expected"`
}

Criterion pins a scorer and the constraints it must satisfy.

type Plan

type Plan struct {
	ID              id.ID       `json:"id"`
	SchemaVersion   int         `json:"schema_version"`
	AppID           string      `json:"app_id"`
	TenantID        string      `json:"tenant_id"`
	Suite           suite.Suite `json:"suite"`
	PromptVersionID string      `json:"prompt_version_id,omitempty"`
	Cases           []Case      `json:"cases"`
	PassThreshold   float64     `json:"pass_threshold"`
	Digest          string      `json:"digest"`
	CreatedAt       time.Time   `json:"created_at"`
}

Plan freezes scoring inputs independently of any target or agent runtime.

func Decode

func Decode(ctx context.Context, data []byte) (*Plan, error)

Decode reads and validates a stored plan without sharing mutable data.

func (Plan) ContentDigest

func (p Plan) ContentDigest() (string, error)

ContentDigest hashes scoring content, excluding storage identity and time.

func (*Plan) Validate

func (p *Plan) Validate(ctx context.Context) error

Validate refuses unsupported, unscoped or modified frozen plans.

type Store

type Store interface {
	CreateEvaluationPlan(context.Context, *Plan) error
	GetEvaluationPlan(context.Context, id.ID) (*Plan, error)
}

Store persists immutable plans with exact app and tenant scope.

Jump to

Keyboard shortcuts

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