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

eval

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package eval evaluates frozen examples with typed, local answers. It does not call a provider and its counts do not measure live model accuracy.

Index

Constants

View Source
const MaxCorpusBytes = 256 << 10
View Source
const SchemaVersion = "lintpal.eval.corpus.v1"

Variables

View Source
var ErrInvalidCorpus = errors.New("invalid evaluation corpus")

Functions

This section is empty.

Types

type Case

type Case struct {
	ID          string  `json:"id"`
	Path        string  `json:"path"`
	Line        int     `json:"line"`
	Source      string  `json:"source"`
	RuleID      string  `json:"rule_id"`
	Truth       string  `json:"truth"`
	Probability float64 `json:"probability"`
}

type Corpus

type Corpus struct {
	SchemaVersion string `json:"schema_version"`
	Cases         []Case `json:"cases"`
}

func Load

func Load(reader io.Reader) (Corpus, error)

type Outcome

type Outcome struct {
	ID          string `json:"id"`
	RuleID      string `json:"rule_id"`
	Truth       string `json:"truth"`
	Predicted   bool   `json:"predicted"`
	Diagnostics int    `json:"diagnostics"`
}

type Summary

type Summary struct {
	SchemaVersion string    `json:"schema_version"`
	CorpusVersion string    `json:"corpus_version"`
	Cases         []Outcome `json:"cases"`
	TruePositive  int       `json:"true_positive"`
	TrueNegative  int       `json:"true_negative"`
	FalsePositive int       `json:"false_positive"`
	FalseNegative int       `json:"false_negative"`
}

func RunOffline

func RunOffline(ctx context.Context, corpus Corpus) (Summary, []report.Report, error)

RunOffline executes the real selection, decision, and report path against frozen examples. Probabilities are fixture inputs, not model predictions.

Jump to

Keyboard shortcuts

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