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

eval

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Overview

Package eval runs the deterministic, production-backed resolution corpus.

Index

Constants

View Source
const ManifestSchemaVersion = 2

Variables

This section is empty.

Functions

func RunCorpus

func RunCorpus(ctx context.Context, root string, update bool) error

RunCorpus validates every manifest before indexing, then runs every case through initial, unchanged-incremental, and fresh-database evaluation.

func ValidateManifests

func ValidateManifests(manifests []LoadedManifest) error

func VerifyCase added in v0.2.5

func VerifyCase(ctx context.Context, loaded LoadedManifest) error

VerifyCase runs one loaded case through initial, unchanged-incremental, and fresh-database evaluation and compares the result with the expectations its manifest records.

Types

type AmbiguitySpec

type AmbiguitySpec struct {
	Selector   string    `json:"selector"`
	Candidates []NodeRef `json:"candidates"`
}

type DiagnosticRef

type DiagnosticRef struct {
	Repo            string `json:"repo"`
	Path            string `json:"path"`
	Line            int    `json:"line,omitempty"`
	Level           string `json:"level"`
	MessageContains string `json:"message_contains"`
}

type EdgePattern

type EdgePattern struct {
	From     NodeRef        `json:"from"`
	Relation graph.EdgeKind `json:"relation"`
	To       NodeRef        `json:"to"`
}

type EdgeRef

type EdgeRef struct {
	From       NodeRef           `json:"from"`
	Relation   graph.EdgeKind    `json:"relation"`
	To         NodeRef           `json:"to"`
	Source     SourceRef         `json:"source"`
	Properties map[string]string `json:"properties,omitempty"`
}

type Expectations

type Expectations struct {
	Nodes           []NodeRef             `json:"nodes"`
	Edges           []EdgeRef             `json:"edges"`
	Diagnostics     []DiagnosticRef       `json:"diagnostics,omitempty"`
	Queries         []QuerySpec           `json:"queries,omitempty"`
	Ambiguities     []AmbiguitySpec       `json:"ambiguities,omitempty"`
	ForbiddenEdges  []EdgePattern         `json:"forbidden_edges,omitempty"`
	ForbiddenPaths  []PathPattern         `json:"forbidden_paths,omitempty"`
	MessageFlows    []MessageFlowSpec     `json:"message_flows,omitempty"`
	MessageCoverage []MessageCoverageSpec `json:"message_coverage,omitempty"`
	TestCoverage    []TestCoverageSpec    `json:"test_coverage,omitempty"`
}

type LoadedManifest

type LoadedManifest struct {
	Path     string
	Manifest Manifest
}

func LoadCorpus added in v0.2.5

func LoadCorpus(root string) ([]LoadedManifest, error)

LoadCorpus validates every manifest in a corpus root and returns the cases it holds. A case owns its own temporary workspace and database, so a caller may verify the cases concurrently; RunCorpus is the sequential form that can also rewrite expectations.

type Manifest

type Manifest struct {
	SchemaVersion int              `json:"schema_version"`
	CaseID        string           `json:"case_id"`
	Repositories  []RepositorySpec `json:"repositories"`
	Expect        Expectations     `json:"expect"`
}

func LoadManifest

func LoadManifest(path string, input io.Reader) (Manifest, error)

type MessageChannelConflict

type MessageChannelConflict struct {
	Send    MessageTransportResult `json:"send"`
	Receive MessageTransportResult `json:"receive"`
}

type MessageCoverageItem

type MessageCoverageItem struct {
	Message         NodeRef               `json:"message"`
	Status          query.CoverageStatus  `json:"status"`
	Gaps            []string              `json:"gaps"`
	UnknownEvidence []string              `json:"unknown_evidence"`
	Uncertainties   []string              `json:"uncertainties"`
	Members         []MessageMemberResult `json:"members"`
	Truncated       bool                  `json:"truncated"`
}

type MessageCoverageResult

type MessageCoverageResult struct {
	Messages  []MessageCoverageItem `json:"messages"`
	Truncated bool                  `json:"truncated"`
}

type MessageCoverageSpec

type MessageCoverageSpec struct {
	ID      string                       `json:"id"`
	Options query.MessageCoverageOptions `json:"options,omitempty"`
	Result  MessageCoverageResult        `json:"result"`
}

type MessageFlowResult

type MessageFlowResult struct {
	Message           NodeRef                  `json:"message"`
	Status            query.CoverageStatus     `json:"status"`
	Bindings          []string                 `json:"bindings"`
	Members           []MessageMemberResult    `json:"members"`
	Encoders          []string                 `json:"encoders"`
	Decoders          []string                 `json:"decoders"`
	Sends             []MessageTransportResult `json:"sends"`
	Receives          []MessageTransportResult `json:"receives"`
	Handlers          []MessageHandlerResult   `json:"handlers"`
	ChannelMismatches []MessageChannelConflict `json:"channel_mismatches"`
	Gaps              []string                 `json:"gaps"`
	UnknownEvidence   []string                 `json:"unknown_evidence"`
	Uncertainties     []string                 `json:"uncertainties"`
	Truncated         bool                     `json:"truncated"`
}

type MessageFlowSpec

type MessageFlowSpec struct {
	ID       string                   `json:"id"`
	Selector string                   `json:"selector"`
	Options  query.MessageFlowOptions `json:"options,omitempty"`
	Result   MessageFlowResult        `json:"result"`
}

MessageFlowSpec is a schema-versioned golden task query. The compact result records stable semantic identities and evidence IDs instead of duplicating every presentation field returned by the service.

type MessageHandlerResult

type MessageHandlerResult struct {
	Handler  NodeRef  `json:"handler"`
	Evidence string   `json:"evidence"`
	Callers  []string `json:"callers"`
}

type MessageMemberResult

type MessageMemberResult struct {
	Field     NodeRef              `json:"field"`
	Oneof     string               `json:"oneof,omitempty"`
	Status    query.CoverageStatus `json:"status"`
	Producers []string             `json:"producers"`
	Consumers []string             `json:"consumers"`
	Gaps      []string             `json:"gaps"`
}

type MessageTransportResult

type MessageTransportResult struct {
	Operation   NodeRef              `json:"operation"`
	Status      query.CoverageStatus `json:"status"`
	Channel     string               `json:"channel,omitempty"`
	Reliability string               `json:"reliability,omitempty"`
	Sources     []string             `json:"sources"`
}

type NodeRef

type NodeRef struct {
	Repo          string         `json:"repo,omitempty"`
	Kind          graph.NodeKind `json:"kind"`
	QualifiedName string         `json:"qualified_name"`
	External      bool           `json:"external,omitempty"`
}

type PathPattern

type PathPattern struct {
	From      string           `json:"from"`
	To        string           `json:"to"`
	Direction string           `json:"direction,omitempty"`
	Relations []graph.EdgeKind `json:"relations,omitempty"`
}

type QuerySpec

type QuerySpec struct {
	ID        string           `json:"id"`
	From      string           `json:"from"`
	To        string           `json:"to"`
	Direction string           `json:"direction,omitempty"`
	Relations []graph.EdgeKind `json:"relations,omitempty"`
	Nodes     []NodeRef        `json:"nodes"`
	Edges     []EdgeRef        `json:"edges"`
}

type RepositorySpec

type RepositorySpec struct {
	ID   string `json:"id"`
	Path string `json:"path"`
}

type Snapshot

type Snapshot struct {
	Nodes           []NodeRef             `json:"nodes"`
	Edges           []EdgeRef             `json:"edges"`
	Queries         []QuerySpec           `json:"queries,omitempty"`
	MessageFlows    []MessageFlowSpec     `json:"message_flows,omitempty"`
	MessageCoverage []MessageCoverageSpec `json:"message_coverage,omitempty"`
	TestCoverage    []TestCoverageSpec    `json:"test_coverage,omitempty"`
}

type SourceRef

type SourceRef struct {
	Path   string `json:"path"`
	Line   int    `json:"line"`
	Column int    `json:"column,omitempty"`
}

type TestCoverageMatchResult

type TestCoverageMatchResult struct {
	Test      NodeRef          `json:"test"`
	Target    NodeRef          `json:"target"`
	Direct    bool             `json:"direct"`
	Depth     int              `json:"depth"`
	Path      []NodeRef        `json:"path"`
	Relations []graph.EdgeKind `json:"relations"`
}

type TestCoverageResult

type TestCoverageResult struct {
	Root        NodeRef                   `json:"root"`
	Designation string                    `json:"designation"`
	Matches     []TestCoverageMatchResult `json:"matches"`
	Truncated   bool                      `json:"truncated"`
}

type TestCoverageSpec

type TestCoverageSpec struct {
	ID        string                    `json:"id"`
	Direction string                    `json:"direction"`
	Selector  string                    `json:"selector"`
	Options   query.TestCoverageOptions `json:"options,omitempty"`
	Result    TestCoverageResult        `json:"result"`
}

Directories

Path Synopsis
cmd
grafo-eval command

Jump to

Keyboard shortcuts

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