verifier

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrVerificationFailed = fmt.Errorf("verification failed or incomplete")

AgentVerifier implements the Verifier interface using an autonomous agent loop.

Functions

This section is empty.

Types

type AIResponse

type AIResponse struct {
	GoCode          string   `json:"go_code" jsonschema:"description=The converted/fixed Go code (FULL FILE CONTENT)"`
	TestCode        string   `json:"test_code" jsonschema:"description=Unit tests for the converted code (FULL FILE CONTENT)"`
	Recommendations []string `json:"recommendations" jsonschema:"description=Recommendations for the converted code"`
}

AIResponse represents the structured response from the AI for code generation/fixing.

type AgentVerifier

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

func NewAgentVerifier

func NewAgentVerifier(p *props.Props) *AgentVerifier

NewAgentVerifier creates a new AgentVerifier.

func (*AgentVerifier) VerifyAndFix

func (v *AgentVerifier) VerifyAndFix(ctx context.Context, projectRoot, cmdDir string, data *templates.CommandData, aiClient chat.ChatClient, genFunc GeneratorFunc) error

VerifyAndFix runs the agentic verification loop.

type GeneratorFunc

type GeneratorFunc func(ctx context.Context, cmdDir string, data *templates.CommandData) error

GeneratorFunc is a callback that writes the command files (main.go, test.go) based on the data.

type LegacyVerifier

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

LegacyVerifier implements the original 5-retry loop logic.

func NewLegacy

func NewLegacy(p *props.Props, projectPath string) *LegacyVerifier

NewLegacy checks and returns a new LegacyVerifier.

func (*LegacyVerifier) VerifyAndFix

func (v *LegacyVerifier) VerifyAndFix(ctx context.Context, projectRoot, cmdDir string, data *templates.CommandData, aiClient chat.ChatClient, gen GeneratorFunc) error

VerifyAndFix runs the verification loop.

type Verifier

type Verifier interface {
	VerifyAndFix(ctx context.Context, projectRoot, cmdDir string, data *templates.CommandData, aiClient chat.ChatClient, gen GeneratorFunc) error
}

Verifier defines the interface for verifying and fixing generated code.

Jump to

Keyboard shortcuts

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