Documentation
¶
Index ¶
- Constants
- Variables
- func CodingVerifyGuidance(ctx context.Context) string
- func DetectPackageManager(root string) (string, error)
- func ManifestPath(root string) string
- func MaxVerifyNudges(ctx context.Context) int
- func SaveManifest(root string, recipe *Recipe) (string, error)
- type OSError
- type Parser
- type ParserArgument
- type PhaseResult
- type ReadinessResult
- type Recipe
- type RequestError
- type TypeError
- type VerifyOptions
- type VerifyResult
Constants ¶
const ( DefaultPhaseTimeout = 600.0 DefaultReadyTimeout = 60.0 )
const CodingVerifyGuidanceText = "[Coding] Before you run tests/linters or call this done: if this is " +
"creative UI/visual work, hold off on tests and linters until the user says " +
"they like the result or you're about to commit. And before every commit, " +
"clean your work: keep it KISS/DRY, match the surrounding code style, and be " +
"elitist, shorthand, clever, concise, efficient, and elegant."
How-to-verify advice appended to verification stop nudges
const ManifestVersion = 1
Variables ¶
var ( SpawnOwned func(ctx context.Context, cmd *exec.Cmd, purpose string) error ReleaseProcessGroupOnceEmpty func(pgid int, poll func(), timeout time.Duration) bool )
Process ownership of pkg/tools process_identity, installed by the pkg/plugins init
var EvidenceRecorder func(ctx context.Context, root, sessionID string, ok bool, command, scope, output string) (map[string]any, error)
Ledger writer a completed verify run records through, assigned by the agent package
var PhaseOrder = []string{"bootstrap", "build", "test"}
Functions ¶
func CodingVerifyGuidance ¶
Guidance appended to verification stop nudges, empty when agent.verify_guidance of the profile of ctx turns it off
func DetectPackageManager ¶
Package manager named by the first lockfile present, empty when none is
func ManifestPath ¶
Verify manifest path of the project at root
func MaxVerifyNudges ¶
Bound on consecutive pre_verify continue directives per turn from agent.max_verify_nudges of the profile of ctx, never below zero
Types ¶
type Parser ¶
type Parser struct {
Name string
Help string
Description string
Arguments []ParserArgument
JSONHelp string
}
verify subcommand parser, the help, description and arguments the CLI binding builds
func BuildVerifyParser ¶
func BuildVerifyParser() Parser
Parser for the verify subcommand with every flag, choice, default and help text
type ParserArgument ¶
type ParserArgument struct {
Name string
Action string
Choices []string
Default any
Type string
Optional bool
Help string
}
Argument of the verify subcommand, an argparse add_argument call the CLI binding replays
type PhaseResult ¶
type PhaseResult struct {
Phase string
Command string
ExitCode *int
Duration float64
OutputTail string
TimedOut bool
}
PhaseResult is one recipe command run, a nil exit code meaning it timed out
func (*PhaseResult) ToDict ¶
func (p *PhaseResult) ToDict() *jsonutil.Object
JSON mapping of the phase with the duration rounded to milliseconds
type ReadinessResult ¶
type ReadinessResult struct {
URL string
Ready bool
StatusCode *int
Duration float64
Error *string
OutputTail string
}
ReadinessResult is the start phase poll of the app URL
func (*ReadinessResult) ToDict ¶
func (r *ReadinessResult) ToDict() *jsonutil.Object
JSON mapping of the readiness poll with the duration rounded to milliseconds
type Recipe ¶
type Recipe struct {
Name string
Kind string
Bootstrap []string
Build []string
Test []string
Start *string
Port *int
PortTrue bool
ReadinessPath string
Evidence []string
}
Recipe is a runnable verification recipe whose command lists are shell strings run in the project root
func DetectRecipe ¶
Recipe for root in grok order, package.json then Python, Go, Rust, Java, Makefile and compose, nil when none matches
func LoadManifest ¶
Saved recipe in the wrapped or bare shape, nil on any read, decode or shape problem
func LoadOrDetect ¶
Saved manifest recipe with source manifest, else the detected recipe with source detected
func RecipeFromDict ¶
Tolerant recipe loader accepting these field names and the grok camelCase aliases, nil without a usable name
type RequestError ¶
RequestError is the InvalidURL or UnicodeEncodeError http.client raises before sending a readiness request
func (*RequestError) Error ¶
func (e *RequestError) Error() string
type TypeError ¶
type TypeError struct{ Msg string }
TypeError is the Python TypeError a non string start script raises in port inference
type VerifyOptions ¶
type VerifyOptions struct {
Phases []string
PhaseTimeout float64
ReadyTimeout float64
SkipStart bool
PortOverride *int
StopOnFailure bool
OnOutput func(string)
}
VerifyOptions are the run_verify keyword arguments, start from NewVerifyOptions for the defaults
func NewVerifyOptions ¶
func NewVerifyOptions() VerifyOptions
Options with the run_verify defaults, every phase, 600 s phases, 60 s readiness and stop on failure
type VerifyResult ¶
type VerifyResult struct {
RecipeName string
Phases []*PhaseResult
Readiness *ReadinessResult
}
VerifyResult is a whole verification pass
func RunVerify ¶
func RunVerify(ctx context.Context, root string, recipe *Recipe, opts VerifyOptions) (*VerifyResult, error)
Runs the selected phases in order then boots, polls and tears down the app, refusing a compose project with live containers
func (*VerifyResult) OK ¶
func (v *VerifyResult) OK() bool
Reports every phase passing and the app answering when it was started
func (*VerifyResult) ToDict ¶
func (v *VerifyResult) ToDict() *jsonutil.Object
JSON mapping of the pass, readiness null when the app never started