validate

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSValidator

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

func (*FSValidator) PrepareValidation added in v0.4.0

func (v *FSValidator) PrepareValidation(ctx context.Context, contract domain.OutputContract) (PreparedValidation, error)

func (*FSValidator) Validate

func (v *FSValidator) Validate(ctx context.Context, artifact *domain.Artifact, contract domain.OutputContract) (domain.ValidationResult, error)

type PreparedValidation added in v0.4.0

type PreparedValidation interface {
	Validate(ctx context.Context, artifact *domain.Artifact) (domain.ValidationResult, error)
	// SchemaDocument returns the root JSON Schema document used for provider
	// structured output, or nil for non-schema modes. Returned internal
	// immutable state must not be mutated.
	SchemaDocument() any
}

PreparedValidation validates artifacts against one frozen output contract. Its cancellation boundary is synchronous: Validate does not detach schema execution, and an observed context error prevents publication of a result.

type StandardValidator

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

StandardValidator provides basic, JSON, and JSON Schema output validation.

func (*StandardValidator) PrepareValidation added in v0.4.0

func (v *StandardValidator) PrepareValidation(ctx context.Context, contract domain.OutputContract) (PreparedValidation, error)

func (*StandardValidator) Validate

type ValidationPreparer added in v0.4.0

type ValidationPreparer interface {
	PrepareValidation(ctx context.Context, contract domain.OutputContract) (PreparedValidation, error)
}

ValidationPreparer freezes validation resources for one output contract. Preparation reads schemas in context-checked chunks and checks ctx around decoding and compilation. Filesystem and compiler calls remain synchronous, so cancellation becomes authoritative when an in-progress call returns.

type Validator

type Validator interface {
	Validate(ctx context.Context, artifact *domain.Artifact, contract domain.OutputContract) (domain.ValidationResult, error)
}

Validator validates the generated artifact based on the output contract. Validation checks ctx around Promptkit-controlled work and synchronous dependency calls. A dependency call already in progress cannot be preempted; after it returns, cancellation takes precedence over its result.

func NewFSValidator

func NewFSValidator(fsys fs.FS, root string) Validator

func NewStandardValidator

func NewStandardValidator(schemaBaseDir string) Validator

Jump to

Keyboard shortcuts

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