Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoConfig = errors.New("no .moa/verify.json found — create one to define verification checks")
ErrNoConfig is returned by Execute when the project has no .moa/verify.json. Callers that gate on check results (e.g. the goal verifier) use it to tell "no checks defined" apart from "checks defined but failing".
Functions ¶
func FormatResult ¶
FormatResult produces a human-readable summary. Only failed checks include their output.
func NewTool ¶
func NewTool(sessionCWD string, allowed PathChecker) core.Tool
NewTool creates the verify tool. sessionCWD is the workspace root used to locate .moa/verify.json when a call does not name a directory; allowed bounds which other directories a call may target (nil means no bound).
func ResolveWorkDir ¶ added in v0.24.0
func ResolveWorkDir(sessionCWD, dir string, allowed PathChecker) (string, error)
ResolveWorkDir resolves an optional working-directory override against the session's CWD.
An empty dir keeps the session CWD. A relative dir resolves against it. The result must exist, be a directory, and pass allowed: running a .moa/verify.json means running the shell commands it contains, so accepting any directory would turn verify into a way out of the sandbox. In unrestricted (YOLO) mode the policy allows everything, so this only constrains sessions that asked to be constrained.
Types ¶
type Check ¶
type Check struct {
Name string `json:"name"`
Command string `json:"command"`
Timeout string `json:"timeout,omitempty"` // Go duration string, default "5m"
}
Check defines a single verification step.
type CheckResult ¶
type CheckResult struct {
Name string
Command string
Passed bool
Output string // combined stdout+stderr
ExitCode int
TimedOut bool
Elapsed time.Duration
}
CheckResult holds the outcome of a single check execution.
type Config ¶
type Config struct {
Checks []Check `json:"checks"`
}
Config holds the verification configuration loaded from .moa/verify.json.
func LoadConfig ¶
LoadConfig reads .moa/verify.json from cwd. Returns (nil, nil) if the file doesn't exist (feature disabled). Returns (nil, error) if the file exists but is invalid.
type PathChecker ¶ added in v0.24.0
PathChecker reports whether a directory may be used as a verify working directory. *tool.PathPolicy satisfies it; taking the interface keeps pkg/verify from depending on pkg/tool.