verifier

package
v0.1.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VisibilityPrivate = "private"
	RecursionPluginID = "agent-loop-guard"

	DefaultRole    = "loop_guard"
	DefaultTimeout = 4 * time.Second

	MaxResponseBytes  = 4096
	MaxPromptBytes    = 12 * 1024
	MaxReasonBytes    = 512
	MaxObjectiveBytes = 512
	MaxRoleBytes      = 128
)

Variables

View Source
var ErrCollectorUnavailable = errors.New("verifier: collector unavailable")

ErrCollectorUnavailable means no auxiliary collector was composed.

Functions

This section is empty.

Types

type Adapter

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

Adapter runs one detached private auxiliary semantic check.

func New

func New(collector Collector, cfg Config) *Adapter

New constructs a verifier adapter over the smallest auxiliary collector interface. A nil collector is retained and fails closed at Verify time.

func (*Adapter) Verify

func (a *Adapter) Verify(ctx context.Context, in terminaldecision.Input) (Verdict, error)

Verify builds one bounded detached request and conservatively maps every auxiliary, timeout, input, or parser failure to UNCERTAIN plus its typed boundary error.

type Collector

type Collector interface {
	Collect(context.Context, auxiliary.Request) (lipapi.Collected, error)
}

Collector is the only auxiliary capability consumed by this verifier. It deliberately excludes streaming, backend, and runtime execution surfaces.

type Config

type Config struct {
	Role    string
	Timeout time.Duration
}

Config bounds the detached verifier request. Zero values select conservative defaults; composition owns any later feature configuration policy.

type Kind

type Kind string

Kind is the strict semantic verifier result vocabulary.

const (
	VerdictComplete   Kind = "COMPLETE"
	VerdictIncomplete Kind = "INCOMPLETE"
	VerdictUncertain  Kind = "UNCERTAIN"
)

type ParseError

type ParseError struct{ Kind ParseErrorKind }

ParseError is safe to expose in bounded diagnostics: its message contains only a stable parser classification.

func (*ParseError) Error

func (e *ParseError) Error() string

type ParseErrorKind

type ParseErrorKind string

ParseErrorKind identifies a strict parser rejection without response data.

const (
	ParseErrorEmpty            ParseErrorKind = "empty_response"
	ParseErrorTooLarge         ParseErrorKind = "response_too_large"
	ParseErrorMalformed        ParseErrorKind = "malformed_response"
	ParseErrorMultipleValues   ParseErrorKind = "multiple_values"
	ParseErrorUnknownField     ParseErrorKind = "unknown_field"
	ParseErrorDuplicateField   ParseErrorKind = "duplicate_field"
	ParseErrorInvalidKind      ParseErrorKind = "invalid_kind"
	ParseErrorMissingObjective ParseErrorKind = "missing_objective"
)

type Verdict

type Verdict struct {
	Kind      Kind
	Reason    string
	Objective string
}

Verdict is the bounded semantic result. Objective is meaningful only for an INCOMPLETE result and never carries verifier chain-of-thought.

func Parse

func Parse(text string) (Verdict, error)

Parse accepts exactly one bounded JSON object with the strict verifier vocabulary. COMPLETE and UNCERTAIN may omit objective; INCOMPLETE may not.

type Verifier

type Verifier interface {
	Verify(context.Context, terminaldecision.Input) (Verdict, error)
}

Verifier is the seam consumed by the feature provider. The platform owns candidate admission and continuation; this package only returns a bounded semantic verdict.

Jump to

Keyboard shortcuts

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