verify

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 9 Imported by: 1 module, 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

Overview

Package verify runs explicitly configured, named checks and exposes their structured results to the caller and optionally to an agent. It is not a process sandbox and never discovers or executes project commands implicitly.

Index

Constants

This section is empty.

Variables

View Source
var ErrConfig = errors.New("verify: invalid check or suite configuration")

Functions

This section is empty.

Types

type Check

type Check struct {
	Name    string
	Timeout time.Duration
	Run     CheckFunc
}

type CheckFunc

type CheckFunc func(context.Context) (Outcome, error)

CheckFunc is caller-provided trusted code, required to honor ctx. It may run an existing test framework or an isolated execution service. A context deadline is cooperative; the suite does not abandon a running callback.

func Command

func Command(cfg CommandConfig) (CheckFunc, error)

Command adapts os/exec to a CheckFunc. It neither invokes a shell implicitly nor resolves a program through PATH. Output is discarded, not put into model context. Cancellation targets the direct process, not all descendants; use an isolated caller backend for untrusted commands.

type CommandConfig

type CommandConfig struct {
	Executable string
	Dir        string
	Args       []string
	// Env is the explicit environment, not inherited from the host. Go may
	// add platform-required values (e.g. SYSTEMROOT on Windows).
	Env []string
}

CommandConfig defines one fixed foreground command supplied by the caller, not the model. Authorize the executable AND the project (build hooks and test code can have arbitrary effects). No process sandbox is provided.

type Config

type Config struct {
	Checks []Check
	// Timeout includes waiting for another invocation of this suite.
	Timeout time.Duration
}

type Outcome

type Outcome struct {
	Passed   bool
	ExitCode *int
}

Outcome describes a completed check. A false Passed value with no error means an observed negative result, not an execution error.

type Suite

type Suite struct {
	// contains filtered or unexported fields
}

Suite serializes its own invocations. Other suites, workspace handles, external processes and unrelated callers are not locked by it.

func New

func New(cfg Config) (*Suite, error)

func (*Suite) Tool

func (s *Suite) Tool() (agent.Tool, error)

Tool exposes only the entire preconfigured suite, with no model-selected executable, directory, environment or arguments. Failed checks are normal structured results, allowing the model to choose a correction. Raw backend errors are never exposed. A tool call does not replace a configured final gate.

func (*Suite) Verify

func (s *Suite) Verify(ctx context.Context) (agent.VerificationReport, error)

type ToolResult

type ToolResult struct {
	Report   agent.VerificationReport `json:"report"`
	Complete bool                     `json:"complete"`
	Passed   bool                     `json:"passed"`
}

ToolResult makes an interrupted suite distinguishable from all checks passing, even if cancellation occurs just after the last callback.

Jump to

Keyboard shortcuts

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