verify

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ReportContractVersion = "zero.verify.report.v1"
View Source
const RuntimeGo = "go"

Variables

This section is empty.

Functions

This section is empty.

Types

type Attempt

type Attempt struct {
	Number int    `json:"number"`
	Report Report `json:"report"`
}

type Check

type Check struct {
	ID        string               `json:"id"`
	Name      string               `json:"name"`
	Command   []string             `json:"command"`
	Kind      testrunner.Kind      `json:"kind,omitempty"`
	Framework testrunner.Framework `json:"framework,omitempty"`
}

type CommandResult

type CommandResult struct {
	ExitCode int
	Stdout   string
	Stderr   string
}

type Event

type Event struct {
	Type          EventType            `json:"type"`
	Runtime       string               `json:"runtime,omitempty"`
	Contract      string               `json:"contract,omitempty"`
	Root          string               `json:"root,omitempty"`
	CheckID       string               `json:"checkId,omitempty"`
	CheckName     string               `json:"checkName,omitempty"`
	Command       []string             `json:"command,omitempty"`
	Kind          testrunner.Kind      `json:"kind,omitempty"`
	Framework     testrunner.Framework `json:"framework,omitempty"`
	Status        Status               `json:"status,omitempty"`
	ExitCode      int                  `json:"exitCode,omitempty"`
	OK            bool                 `json:"ok,omitempty"`
	Summary       Summary              `json:"summary,omitempty"`
	StartedAt     string               `json:"startedAt,omitempty"`
	EndedAt       string               `json:"endedAt,omitempty"`
	DurationMs    int                  `json:"durationMs,omitempty"`
	Error         string               `json:"error,omitempty"`
	OutputSummary *OutputSummary       `json:"outputSummary,omitempty"`
	TestSummary   *testrunner.Summary  `json:"testSummary,omitempty"`
}

func EventsFromReport

func EventsFromReport(report Report) []Event

type EventType

type EventType string
const (
	EventVerifyStarted  EventType = "verify_started"
	EventCheckFinished  EventType = "verify_check_finished"
	EventVerifyFinished EventType = "verify_finished"
)

type LoopOptions

type LoopOptions struct {
	RunOptions
	MaxAttempts int
	OnFailure   func(context.Context, Attempt) error
}

type LoopReport

type LoopReport struct {
	StartedAt string    `json:"startedAt"`
	EndedAt   string    `json:"endedAt"`
	OK        bool      `json:"ok"`
	Summary   Summary   `json:"summary"`
	Attempts  []Attempt `json:"attempts"`
	Error     string    `json:"error,omitempty"`
}

func RunLoop

func RunLoop(ctx context.Context, plan Plan, options LoopOptions) LoopReport

type OutputSummary

type OutputSummary struct {
	Lines     []string `json:"lines,omitempty"`
	Truncated bool     `json:"truncated,omitempty"`
}

type Plan

type Plan struct {
	Root   string  `json:"root"`
	Checks []Check `json:"checks"`
}

func DetectPlan

func DetectPlan(root string) (Plan, error)

type Report

type Report struct {
	Root      string   `json:"root"`
	StartedAt string   `json:"startedAt"`
	EndedAt   string   `json:"endedAt"`
	OK        bool     `json:"ok"`
	Summary   Summary  `json:"summary"`
	Results   []Result `json:"results"`
}

func Run

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

type ReportSnapshot

type ReportSnapshot struct {
	Contract  string           `json:"contract"`
	Runtime   string           `json:"runtime"`
	Root      string           `json:"root"`
	StartedAt string           `json:"startedAt"`
	EndedAt   string           `json:"endedAt"`
	OK        bool             `json:"ok"`
	Summary   Summary          `json:"summary"`
	Results   []ResultSnapshot `json:"results"`
	Events    []Event          `json:"events"`
}

func SnapshotFromReport

func SnapshotFromReport(report Report) ReportSnapshot

type Result

type Result struct {
	ID            string               `json:"id"`
	Name          string               `json:"name"`
	Command       []string             `json:"command"`
	Kind          testrunner.Kind      `json:"kind,omitempty"`
	Framework     testrunner.Framework `json:"framework,omitempty"`
	Status        Status               `json:"status"`
	ExitCode      int                  `json:"exitCode"`
	Stdout        string               `json:"stdout,omitempty"`
	Stderr        string               `json:"stderr,omitempty"`
	StartedAt     string               `json:"startedAt"`
	EndedAt       string               `json:"endedAt"`
	DurationMs    int                  `json:"durationMs"`
	Error         string               `json:"error,omitempty"`
	OutputSummary *OutputSummary       `json:"outputSummary,omitempty"`
	TestSummary   *testrunner.Summary  `json:"testSummary,omitempty"`
}

type ResultSnapshot

type ResultSnapshot struct {
	ID            string               `json:"id"`
	Name          string               `json:"name"`
	Command       []string             `json:"command"`
	Kind          testrunner.Kind      `json:"kind,omitempty"`
	Framework     testrunner.Framework `json:"framework,omitempty"`
	Status        Status               `json:"status"`
	ExitCode      int                  `json:"exitCode"`
	Stdout        string               `json:"stdout,omitempty"`
	Stderr        string               `json:"stderr,omitempty"`
	StartedAt     string               `json:"startedAt"`
	EndedAt       string               `json:"endedAt"`
	DurationMs    int                  `json:"durationMs"`
	Error         string               `json:"error,omitempty"`
	OutputSummary *OutputSummary       `json:"outputSummary,omitempty"`
	TestSummary   *testrunner.Summary  `json:"testSummary,omitempty"`
}

func SnapshotFromResult

func SnapshotFromResult(result Result) ResultSnapshot

type RunOptions

type RunOptions struct {
	Only      []string
	TimeoutMS int
	Runner    Runner
	Now       func() time.Time
}

type Status

type Status string
const (
	StatusPass  Status = "pass"
	StatusFail  Status = "fail"
	StatusError Status = "error"
)

type Summary

type Summary struct {
	Total  int `json:"total"`
	Passed int `json:"passed"`
	Failed int `json:"failed"`
	Errors int `json:"errors"`
}

Jump to

Keyboard shortcuts

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