verification

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package verification records bounded, content-free evidence from admitted tool results. It is an optional development-profile composition: merely constructing an Observer does not alter tool policy or turn completion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assessment

type Assessment struct {
	Status         Status   `json:"status"`
	MaterialWrites bool     `json:"material_writes"`
	ChangedPaths   []string `json:"changed_paths,omitempty"`
	EvidenceIDs    []string `json:"evidence_ids,omitempty"`
}

type CheckScope

type CheckScope string
const (
	CheckTargeted CheckScope = "targeted"
	CheckBroader  CheckScope = "broader"
)

type Config

type Config struct {
	MaxRecordsPerSession int
	Recipes              []Recipe
	Now                  func() time.Time
}

type Observer

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

Observer implements the existing hooks.ToolObserver and the optional richer hooks.ToolResultObserver. It stores no arguments or output payloads.

func NewObserver

func NewObserver(config Config) (*Observer, error)

func (*Observer) Assess

func (o *Observer) Assess(addr protocol.MessageAddress) Assessment

Assess distinguishes targeted success, broader success, failed checks, and no validation run while reporting the paths actually changed.

func (*Observer) ConsumeFinishNudge

func (o *Observer) ConsumeFinishNudge(addr protocol.MessageAddress) (string, bool)

ConsumeFinishNudge returns at most one reminder per session when material writes lack successful configured validation evidence.

func (*Observer) Records

func (o *Observer) Records(addr protocol.MessageAddress) []Record

func (*Observer) ToolFinished

func (*Observer) ToolFinished(context.Context, hooks.ToolCall, bool, error)

func (*Observer) ToolResult

func (o *Observer) ToolResult(ctx context.Context, call hooks.ToolCall, result tools.Result, runErr error)

func (*Observer) ToolStarted

func (*Observer) ToolStarted(context.Context, hooks.ToolCall)

type Recipe

type Recipe struct {
	Name             string
	ToolName         string
	ArgumentsContain []string
	Scope            CheckScope
}

Recipe identifies a validation command without prescribing one globally. Every ArgumentsContain fragment must occur in the admitted JSON arguments.

type Record

type Record struct {
	ID               string                  `json:"id"`
	Addr             protocol.MessageAddress `json:"addr"`
	CallID           string                  `json:"call_id"`
	ToolName         string                  `json:"tool_name"`
	ArgumentsHash    string                  `json:"arguments_hash"`
	WorkingDirectory string                  `json:"working_directory,omitempty"`
	ExitCode         int                     `json:"exit_code,omitempty"`
	IsError          bool                    `json:"is_error,omitempty"`
	CheckName        string                  `json:"check_name,omitempty"`
	CheckScope       CheckScope              `json:"check_scope,omitempty"`
	FileChanges      []tools.FileChange      `json:"file_changes,omitempty"`
	References       []tools.ResultReference `json:"references,omitempty"`
	FinishedAt       string                  `json:"finished_at"`
}

type Status

type Status string
const (
	StatusNotRun         Status = "not_run"
	StatusChecksFailed   Status = "checks_failed"
	StatusTargetedPassed Status = "targeted_checks_passed"
	StatusBroaderPassed  Status = "broader_suite_passed"
)

Jump to

Keyboard shortcuts

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