selfverify

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 4 Imported by: 0

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