selfverify

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const LoopContractVersion = "zero.selfverify.report.v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Attempt

type Attempt struct {
	Number      int           `json:"number"`
	Report      verify.Report `json:"report"`
	Remediation *Remediation  `json:"remediation,omitempty"`
}

type AttemptSnapshot

type AttemptSnapshot struct {
	Number      int                   `json:"number"`
	Report      verify.ReportSnapshot `json:"report"`
	Remediation *Remediation          `json:"remediation,omitempty"`
}

type Event

type Event struct {
	Type        EventType      `json:"type"`
	Runtime     string         `json:"runtime,omitempty"`
	Contract    string         `json:"contract,omitempty"`
	Root        string         `json:"root,omitempty"`
	Attempt     int            `json:"attempt,omitempty"`
	Status      verify.Status  `json:"status,omitempty"`
	OK          bool           `json:"ok,omitempty"`
	StopReason  StopReason     `json:"stopReason,omitempty"`
	Summary     verify.Summary `json:"summary,omitempty"`
	StartedAt   string         `json:"startedAt,omitempty"`
	EndedAt     string         `json:"endedAt,omitempty"`
	Error       string         `json:"error,omitempty"`
	Remediation *Remediation   `json:"remediation,omitempty"`
}

func EventsFromReport

func EventsFromReport(report Report) []Event

type EventType

type EventType string
const (
	EventLoopStarted     EventType = "selfverify_started"
	EventAttemptFinished EventType = "selfverify_attempt_finished"
	EventLoopFinished    EventType = "selfverify_finished"
)

type LoopSnapshot

type LoopSnapshot struct {
	Contract   string            `json:"contract"`
	Runtime    string            `json:"runtime"`
	Root       string            `json:"root,omitempty"`
	StartedAt  string            `json:"startedAt"`
	EndedAt    string            `json:"endedAt"`
	OK         bool              `json:"ok"`
	StopReason StopReason        `json:"stopReason"`
	Summary    verify.Summary    `json:"summary"`
	Attempts   []AttemptSnapshot `json:"attempts"`
	Error      string            `json:"error,omitempty"`
	Events     []Event           `json:"events"`
}

func SnapshotFromReport

func SnapshotFromReport(report Report) LoopSnapshot

type Options

type Options struct {
	RunOptions  verify.RunOptions
	MaxAttempts int
	Remediator  Remediator
}

type Remediation

type Remediation struct {
	StartedAt string `json:"startedAt,omitempty"`
	EndedAt   string `json:"endedAt,omitempty"`
	Applied   bool   `json:"applied"`
	Message   string `json:"message,omitempty"`
	Error     string `json:"error,omitempty"`
}

type Remediator

type Remediator func(context.Context, Attempt) (Remediation, error)

type Report

type Report struct {
	Root       string         `json:"root,omitempty"`
	StartedAt  string         `json:"startedAt"`
	EndedAt    string         `json:"endedAt"`
	OK         bool           `json:"ok"`
	StopReason StopReason     `json:"stopReason"`
	Summary    verify.Summary `json:"summary"`
	Attempts   []Attempt      `json:"attempts"`
	Error      string         `json:"error,omitempty"`
}

func Run

func Run(ctx context.Context, plan verify.Plan, options Options) Report

type StopReason

type StopReason string
const (
	StopReasonPassed          StopReason = "passed"
	StopReasonMaxAttempts     StopReason = "max_attempts"
	StopReasonRemediatorError StopReason = "remediator_error"
	StopReasonContextCanceled StopReason = "context_canceled"
)

Jump to

Keyboard shortcuts

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