verify

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package verify generates and runs AI-produced shell verification scripts after each PM task completes. The script checks observable artifacts—new files, successful command exit codes, expected output—to confirm the task was genuinely accomplished rather than merely claimed done.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateScriptPrompt

func GenerateScriptPrompt(task *pm.Task, taskOutput string) string

GenerateScriptPrompt builds the prompt sent to the AI to produce the verification script. Exported so it can be tested independently.

func ParseScript

func ParseScript(response string) string

ParseScript extracts the shell script from the AI response. It looks for a ```bash ... ``` block. If none is found it attempts to use the entire response as-is (trimmed).

Types

type Result

type Result struct {
	Script   string // the shell script that was generated
	Output   string // combined stdout+stderr from the script
	ExitCode int    // 0 = pass
	Passed   bool   // true when ExitCode == 0
}

Result holds the outcome of a verification run.

func GenerateAndRun

func GenerateAndRun(
	ctx context.Context,
	p provider.Provider,
	model string,
	timeout time.Duration,
	workDir string,
	task *pm.Task,
	taskOutput string,
) (*Result, error)

GenerateAndRun asks the provider to generate a verification script for the given task, writes it to a temp file, executes it in workDir, and returns the result. The caller is responsible for persisting the result as an artifact and for triggering failure diagnosis when Passed == false.

Jump to

Keyboard shortcuts

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